src/Kunstmaan/NodeSearchBundle/Configuration/NodePagesConfiguration.php
protected function getAclPermissions($object)
    {
        $roles = [];

        try {
            $objectIdentity = ObjectIdentity::fromDomainObject($object);

            /* @var AclInterface $acl */
            $acl = $this->aclProvider->findAcl($objectIdentity);
            $objectAces = $acl->getObjectAces();

            /* @var AuditableEntryInterface $ace */
            foreach ($objectAces as $ace) {
                $securityIdentity = $ace->getSecurityIdentity();
                if (
                    $securityIdentity instanceof RoleSecurityIdentity &&
                    ($ace->getMask() & MaskBuilder::MASK_VIEW != 0)
                ) {
                    $roles[] = $securityIdentity->getRole();
                }
            }
        } catch (AclNotFoundException $e) {
            // No ACL found... assume default
            $roles = array('IS_AUTHENTICATED_ANONYMOUSLY');
        }

        return $roles;
    }
protected function getAclPermissions($object)
    {
        $roles = [];

        try {
            $objectIdentity = ObjectIdentity::fromDomainObject($object);

            /* @var AclInterface $acl */
            $acl = $this->aclProvider->findAcl($objectIdentity);
            $objectAces = $acl->getObjectAces();

            /* @var AuditableEntryInterface $ace */
            foreach ($objectAces as $ace) {
                $securityIdentity = $ace->getSecurityIdentity();
                if (
                    $securityIdentity instanceof RoleSecurityIdentity &&
                    ($ace->getMask() & MaskBuilder::MASK_VIEW != 0)
                ) {
                    $roles[] = $securityIdentity->getRole();
                }
            }
        } catch (AclNotFoundException $e) {
            // No ACL found... assume default
            $roles = array('IS_AUTHENTICATED_ANONYMOUSLY');
        }

        return $roles;
    }
protected function getAclPermissions ( $ object ) { $ roles = [ ] ; try { $ objectIdentity = ObjectIdentity :: fromDomainObject ( $ object ) ; /* @var AclInterface $acl */ $ acl = $ this -> aclProvider -> findAcl ( $ objectIdentity ) ; $ objectAces = $ acl -> getObjectAces ( ) ; /* @var AuditableEntryInterface $ace */ foreach ( $ objectAces as $ ace ) { $ securityIdentity = $ ace -> getSecurityIdentity ( ) ; if ( $ securityIdentity instanceof RoleSecurityIdentity && ( $ ace -> getMask ( ) & MaskBuilder :: MASK_VIEW != 0 ) ) { $ roles [ ] = $ securityIdentity -> getRole ( ) ; } } } catch ( AclNotFoundException $ e ) { // No ACL found... assume default $ roles = array ( 'IS_AUTHENTICATED_ANONYMOUSLY' ) ; } return $ roles ; }
Fetch ACL permissions for the specified entity

@param object $object

@return array
Fetch ACL permissions for the specified entity