Symfony2:如何查找对某个域对象具有权限的用户?
在基于 Symfony2 的应用程序中,我们希望创建一个列表,其中列出系统中哪些用户拥有给定域对象的权限。我们正在使用 ACL,我们的直接直觉是在从相关域对象的 ACLProvider 返回的 ACL 对象中查找可以返回具有权限的用户(或至少 SecurityIdentities)的方法,但我找不到这样的方法方法。
我们确信可以通过 API 使用此功能,但我们无法找到这些方法隐藏的位置。
编辑另一种方法是直接在 acl 表中查找这些连接并找出这种方式,但这不会很漂亮,我们可能会重新发明轮子。
In our application based on Symfony2 we would like to create a list of which of the users in the system that has permissions for a given domain object. We are using ACL and our immediate instinct was to look in the ACL-object returned from the ACLProvider of the domain object in question, for methods that could return the users (or at least SecurityIdentities) that has permissions, but I could not find such methods.
We are certain that this functionality is available through the API, but we cannot find where these methods are hidden.
EDIT An alternative would be to look up these connections in the acl-tables directly and finding out that way, but it would not be very pretty and we would probably be reinventing the wheel.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,授权在文件 app/config/security.yml 中指定。它描述是否允许角色访问某些模块。
授权和权限之间存在一些差异。
默认情况下,权限不是由 Symfony 管理的,而是通过特定的开发(或捆绑......)
By default, the Authorization are specified in the file app/config/security.yml. It describe if a Role is allowed or not to access some modules.
There are some differences between Authorization and Permissions.
Permission are not managed by default by Symfony but through specific development (or bundles...)