Spring ACL 投票者配置
因此,我尝试在我的项目中实现一个简单的 ACL 示例,一切正常。我有以下配置:
<property name="decisionVoters">
<list>
<ref bean="categoryReadVoter"/>
</list>
</property>
<constructor-arg ref="mutableAclService"/>
<constructor-arg value="VOTE_CATEGORY_READ"/>
<constructor-arg>
<array>
<util:constant static-field="org.springframework.security.acls.domain.Ba sePermission.READ"/>
</array>
</constructor-arg>
<property name="processDomainObjectClass" value="packet.Group"/>
现在,我的项目中有大约 30 个实体,我想为每个实体定义至少 4 个角色(创建、读取、写入、管理)。我是否必须为每个实体角色对定义一个 bean?有没有更简单的方法来做到这一点?我是否总是必须使用 为选民设置特定类别?
该项目中还预计会有新功能、新实体和角色。我是否必须在配置文件中配置每个新实体和角色,或者是否有更通用的方法来执行此操作。您能给我一些例子或文档吗?
我目前正在使用 Spring Security 3.1。
谢谢
PS 我已经在 Spring Security 论坛上发布了我的问题,但我想我也应该尝试一下
So I have tried to implement a simple ACL example in my project and everything works as it should. I have the following configuration:
<property name="decisionVoters">
<list>
<ref bean="categoryReadVoter"/>
</list>
</property>
<constructor-arg ref="mutableAclService"/>
<constructor-arg value="VOTE_CATEGORY_READ"/>
<constructor-arg>
<array>
<util:constant static-field="org.springframework.security.acls.domain.Ba sePermission.READ"/>
</array>
</constructor-arg>
<property name="processDomainObjectClass" value="packet.Group"/>
Now, I have about 30 Entities in my project and I want to define at least 4 roles for each (create, read, write, administrate). Do I have to define a bean for each entity-role pair? Is there a simpler way to do this? Do I always have to set a specific class for a voter using ?
New features and new Entities and roles are also to be expected in this project. Do I have to configure each new Entity and role in my config file or is there a more general way to do this. Could you please point me to some examples or docu?
I am currently using Spring Security 3.1.
Thanks
P.S. I have already posted my questions in the Spring Security Forum but thought I'd give this a try as well
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
所以我找到了答案。
您可以使用接口代替实体,并让实体实现接口。
So I have found the answer.
You can use a interface instead of an entity and let the entity implement the interface.