AclProvider::findAcls($oids, $sids) 的作用是什么?
AclProvider: 是什么: :findAcls($oids, $sids)
实际上吗?对我来说,它返回一个数组(SplObjectStorage
)。我如何从他们那里获取 ACL?
更新
我正在尝试获取特定用户的所有 ACE,以便我可以删除它们。例如。删除用户时。我希望我走在正确的轨道上,比如使用正确的功能?
What does AclProvider::findAcls($oids, $sids)
actually do? For me it returns an array (SplObjectStorage<ObjectIdentities>
). How do I get the ACL's from them?
UPDATE
I am trying to get all ACE's for a specific user so I can remove them. eg. On removing of a user. I hope I am on the right track, like using the right function?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AclProvider::findAcls()
用于批量加载 ACL。它用于有许多不同对象(最终是对象标识)的情况。考虑一个示例
假设您有一系列类别,并且每个用户只能查看其中的一部分。要填充用户可以查看的类别列表,我必须检查 ACL。
我首先查找所有类别,创建对象标识数组 (
$oids[] = ObjectIdentity::fromDomainObject($category)
),然后调用findAcl
方法 ($acl_provider->findAcls($oids)
)。我现在可以为每个$category
$this->container->get('security.context')->isGranted('VIEW', $category) > 并且应用程序将不再查询数据库,因为 ACL 已预加载。至于删除所有 ACE,我认为您可以删除整个 ACL,ACE 也会被删除。您可以通过调用
$acl_provier->deleteAcl($object_identity)
来完成此操作AclProvider::findAcls()
is used for batch loading ACL's. It's used in circumstances where you have many different objects (eventually object identities).Consider an example
Suppose you have a range of categories and each user can view only a portion of them. To populate a list of categories the user can view, I'd have to check the ACL's.
I'd begin by finding all the categories, the creating an array of object identities (
$oids[] = ObjectIdentity::fromDomainObject($category)
) and then call thefindAcl
method ($acl_provider->findAcls($oids)
). I can now call$this->container->get('security.context')->isGranted('VIEW', $category)
for each$category
and the application wouldn't query the database anymore as the ACL was preloaded.As for removing all ACE's I think you can delete the whole ACL and the ACE's get removed as well. You'd do this by calling
$acl_provier->deleteAcl($object_identity)