列出 Zend_ACL 中的规则
我正在使用 zend_acl 来管理我的 Web 应用程序中的 ACL 列表。 为了能够显示“管理权限”对话框,我需要能够获取以下组合的定义规则:
- 为特定资源上的特定角色设置的规则
- 为特定资源上的角色设置的所有规则(谁对此拥有哪些权限)
- 为任何资源上的特定角色设置的所有规则(该角色拥有哪些权限)
为了能够显示完整的列表,必须始终有一个附加列表,其中包含从父角色/资源继承的规则。
您知道如何解决这个问题吗?
I'm using zend_acl to manage ACL lists in my web application.
To be able to show a 'Manage Permissions' Dialogue I need a possibility to get defined rules for the following combinations:
- rules set for a specific role on a specific resource
- all rules that have been set for roles on a specific resource (who has which rights on this)
- all rules that have been set for a specific role on any resource (which rights does the role have)
To be able to display a complete list there must always be an additional list with rules that have been inherited from parent roles/resources.
Do you have any idea how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过这种方式检索所有角色和资源,
我认为您必须扩展 Zend_Acl 才能检索“每个角色注册的资源”。
如果项目如此“扩展”,通常,我会从数据库动态生成 Acl,但我在身边创建了一个 Zend_Acl 扩展
You can retrieve all the roles and the resources this way
I think you have to extend Zend_Acl for retrieve the "registered resources per role".
If the project is so "extended", usually, I generate the Acl dinamically from database, but I created a Zend_Acl extension by my side
为了概述,我们创建了一个表,其中水平方向是资源,垂直方向是角色(按照 MiPnamic 建议接收)。在表的主体中有零和一(允许、拒绝)。效果很好。
For overview we created a table where horizontally are resources, vertcally roles (received as MiPnamic suggested). And in the body of the table there are zeros a ones (allowed, denied). It works fine.