src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php
public function initialize(AbstractEntity $resource, PermissionMapInterface $permissionMap)
    {
        $this->resource = $resource;
        $this->permissionMap = $permissionMap;
        $this->permissions = array();

        // Init permissions
        try {
            $objectIdentity = $this->oidRetrievalStrategy->getObjectIdentity($this->resource);
            /* @var $acl AclInterface */
            $acl = $this->aclProvider->findAcl($objectIdentity);
            $objectAces = $acl->getObjectAces();
            /* @var $ace AuditableEntryInterface */
            foreach ($objectAces as $ace) {
                $securityIdentity = $ace->getSecurityIdentity();
                if ($securityIdentity instanceof RoleSecurityIdentity) {
                    $this->permissions[$securityIdentity->getRole()] = new MaskBuilder($ace->getMask());
                }
            }
        } catch (AclNotFoundException $e) {
            // No Acl found - do nothing (or should we initialize with default values here?)
        }
    }
public function initialize(AbstractEntity $resource, PermissionMapInterface $permissionMap)
    {
        $this->resource = $resource;
        $this->permissionMap = $permissionMap;
        $this->permissions = array();

        // Init permissions
        try {
            $objectIdentity = $this->oidRetrievalStrategy->getObjectIdentity($this->resource);
            /* @var $acl AclInterface */
            $acl = $this->aclProvider->findAcl($objectIdentity);
            $objectAces = $acl->getObjectAces();
            /* @var $ace AuditableEntryInterface */
            foreach ($objectAces as $ace) {
                $securityIdentity = $ace->getSecurityIdentity();
                if ($securityIdentity instanceof RoleSecurityIdentity) {
                    $this->permissions[$securityIdentity->getRole()] = new MaskBuilder($ace->getMask());
                }
            }
        } catch (AclNotFoundException $e) {
            // No Acl found - do nothing (or should we initialize with default values here?)
        }
    }
public function initialize ( AbstractEntity $ resource , PermissionMapInterface $ permissionMap ) { $ this -> resource = $ resource ; $ this -> permissionMap = $ permissionMap ; $ this -> permissions = array ( ) ; // Init permissions try { $ objectIdentity = $ this -> oidRetrievalStrategy -> getObjectIdentity ( $ this -> resource ) ; /* @var $acl AclInterface */ $ acl = $ this -> aclProvider -> findAcl ( $ objectIdentity ) ; $ objectAces = $ acl -> getObjectAces ( ) ; /* @var $ace AuditableEntryInterface */ foreach ( $ objectAces as $ ace ) { $ securityIdentity = $ ace -> getSecurityIdentity ( ) ; if ( $ securityIdentity instanceof RoleSecurityIdentity ) { $ this -> permissions [ $ securityIdentity -> getRole ( ) ] = new MaskBuilder ( $ ace -> getMask ( ) ) ; } } } catch ( AclNotFoundException $ e ) { // No Acl found - do nothing (or should we initialize with default values here?) } }
Initialize permission admin with specified entity.

@param AbstractEntity         $resource      The object which has the permissions
@param PermissionMapInterface $permissionMap The permission map to use
Initialize permission admin with specified entity .