Symfony2 ACL 问题
我一直在尝试在我正在开发的系统中实现 ACL 有几个问题。这主要是因为完全缺乏 有关该主题的文档。如果我们可以的话那就太好了 有关这个复杂而基本的组件的更多信息。无论如何,我都会 一旦我理解了就很乐意写一些东西
无论如何,我遇到的问题如下: 1. 我在 Class-Field-Scope ACE 中拥有查看和编辑字段的角色 一个物体的。当我使用以下命令签入视图时: isGranted('VIEW', object, 'myField')
始终为 false。类范围不应该应用于所有实例 班级?我不太确定这个范围是如何工作的。
- 当我删除一个组时,我想删除与该组相关的所有 ACL 条目 那个团体。我尝试过这样的: $aclProvider->deleteAcl(ObjectIdentity::fromDomainObject($group))
它有效。然后我尝试创建一个新组。群组创建完毕, 但 ACL 设置失败并出现以下错误:
注意:未定义的偏移量:Project/vendor/symfony/src/Symfony/ 中的 0 Component/Security/Acl/Dbal/MutableAclProvider.php 第 850 行
非常感谢任何帮助!
I've been trying to implement ACL in a system I'm developing and
had several problems. This is mostly because the total lack of
documentation on the subject. It'd be really nice if we could have
more info on this complex and fundamental component. In any case, I'd
be happy to write something once I understand
Anyway, the problems I'm having are the following:
1. I have a role with Class-Field-Scope ACE to view and edit a field
of an object. When I check in the view using this:
isGranted('VIEW', object, 'myField')
It's always false. Shouldn't class-scope apply to all instance of the
class? I'm not really sure how this scope works.
- When I delete a group, I want to delete all ACL entries related to
that group. I've tried like this:
$aclProvider->deleteAcl(ObjectIdentity::fromDomainObject($group))
It works. Then I try to create a new group. The group gets created,
but the ACL setup fails with this error:
Notice: Undefined offset: 0 in Project/vendor/symfony/src/Symfony/
Component/Security/Acl/Dbal/MutableAclProvider.php line 850
Any help is greately appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:我已经更新了源代码,现在它是一个更好的解决方案。
我最近一直在尝试 ACL 和 Symfony2。
根据我的发现这是检查类字段范围的方法:
关于删除 ACL 到目前为止我还不知道,稍后我需要研究这个问题。我希望这有帮助!
有关该主题的更多信息。可能不适合您,但对于其他用户可能会有所帮助:Smyfony2 和 ACL< /a>
问候
雷托
EDIT: I have updated the source code, it's a much better solution now.
I have been experimenting with ACL and Symfony2 a little bit recently.
From what I have discovered this is the way to check class-field-scope:
About deleting ACLs I have no knowledge so far, I will need to look into that matter sometime later. I hope this helps!
Some more information about the topic. Probably not for you but for other users it could be helpful: Smyfony2 and ACLs
Regards
Reto