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?
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 thefindAclmethod ($acl_provider->findAcls($oids)). I can now call$this->container->get('security.context')->isGranted('VIEW', $category)for each$categoryand 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)