Java 中良好的 ACL 实现
我正在实现一个基于 Web 的文档管理系统,并且我想在我的系统中实现 ACL。 我的正式需求是分层权限(文档从其文件夹继承权限)用户组(用户可以动态创建组并将用户与组关联)。此类组可以拥有系统中对象的权限。
我的代码将在两种情况下查询对象的权限: 1. 操作单个文档 2.列出所有可以进行操作的文档
后一个要求似乎是 Spring Security ACL 的致命弱点(他们的方法似乎可能会导致我管理的每个文档多次数据库命中)
有人知道另一个 ACL 实现吗?
谢谢!
I'm implementing a web based document management system and I'd like to implement ACLs in my system.
My formal requirements are hierarchal permissions (documents inherit permissions from their folders) user groups (users can dynamically create groups and associate users with groups). Such groups can have permissions on objects in the system.
My code will query permission on objects in two cases:
1. Manipulating a single document
2. Listing all documents where a manipulation is possible
The latter requirement seems the achilles heel for Spring Security ACLs (their method seems likely to incur multiple DB hits for each document I manage)
Anyone know of another ACL implementation?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不熟悉 Spring Security 的 ACL,但我相信典型的 ACL 是否要求您访问每个节点以发现给定主体是否具有该节点上的权限。我不知道您是否会找到解决该问题的方法,而无需每次在您呈现的每个节点上进行 canRead() 或 canAccess() 调用(或类似的调用)。
顺便说一句:
您是否使用符合 JSR-170 的内容(Java 内容存储库或“JCR”)进行评估,而不是滚动自己的完整文档管理系统实现?您可能可以使用 JCR 中的内容作为后端,并在其上简单地编写一个 Web 界面。 Jackrabbit 有一个默认的 ACL 实现,应该足够了。
I'm not familiar with Spring Security's ACLs, but I believe that typical ACL's do you require you to hit each node to discover whether a given principal has permissions on that node. I don't know if you are going to find a way around that problem without making a canRead() or canAccess() call (or something similar) each time on each the nodes you are presenting.
As an aside:
Have you evaluated using something that's JSR-170 compliant (Java Content Repository or 'JCR') instead of rolling your own full document management system implementation? Potentially, you could use the things in JCR for the backend and simply write a web interface on top of it. Jackrabbit has a default ACL implementation that should suffice.