/** * Gets all ACEs associated with given ACL and the given security identity * * @param SID $sid * @param AclInterface $acl * @param string $type The ACE type. Can be one of AclManager::*_ACE constants * @param string|null $field The name of a field. * Set to null for class-based or object-based ACE * Set to not null class-field-based or object-field-based ACE * @return EntryInterface[] */ protected function getAces(SID $sid, AclInterface $acl, $type, $field) { return array_filter($this->manager->getAceProvider()->getAces($acl, $type, $field), function ($ace) use(&$sid) { /** @var EntryInterface $ace */ return $sid->equals($ace->getSecurityIdentity()); }); }