public function setObjectACL($entity, $aces, $type)
    {
        if ($type != "object") {
            throw new \RuntimeException('ACEs of type ' . $type . ' are not supported.');
        }

        $acl     = $this->getAcl($entity);
        $oldAces = $acl->getObjectAces();

        // Delete old ACEs
        foreach (array_reverse(array_keys($oldAces)) as $idx) {
            $acl->deleteObjectAce(intval($idx));
        }
        $this->aclProvider->updateAcl($acl);
        // Add new ACEs
        foreach (array_reverse($aces) as $idx => $ace) {
            // If no mask is given, we might as well not insert the ACE
            if ($ace['mask'] === 0) {
                continue;
            }
            $acl->insertObjectAce($ace['sid'], $ace['mask']);
        }

        $this->aclProvider->updateAcl($acl);
    }
public function setObjectACL($entity, $aces, $type)
    {
        if ($type != "object") {
            throw new \RuntimeException('ACEs of type ' . $type . ' are not supported.');
        }

        $acl     = $this->getAcl($entity);
        $oldAces = $acl->getObjectAces();

        // Delete old ACEs
        foreach (array_reverse(array_keys($oldAces)) as $idx) {
            $acl->deleteObjectAce(intval($idx));
        }
        $this->aclProvider->updateAcl($acl);
        // Add new ACEs
        foreach (array_reverse($aces) as $idx => $ace) {
            // If no mask is given, we might as well not insert the ACE
            if ($ace['mask'] === 0) {
                continue;
            }
            $acl->insertObjectAce($ace['sid'], $ace['mask']);
        }

        $this->aclProvider->updateAcl($acl);
    }
public function setObjectACL ( $ entity , $ aces , $ type ) { if ( $ type != "object" ) { throw new \ RuntimeException ( 'ACEs of type ' . $ type . ' are not supported.' ) ; } $ acl = $ this -> getAcl ( $ entity ) ; $ oldAces = $ acl -> getObjectAces ( ) ; // Delete old ACEs foreach ( array_reverse ( array_keys ( $ oldAces ) ) as $ idx ) { $ acl -> deleteObjectAce ( intval ( $ idx ) ) ; } $ this -> aclProvider -> updateAcl ( $ acl ) ; // Add new ACEs foreach ( array_reverse ( $ aces ) as $ idx => $ ace ) { // If no mask is given, we might as well not insert the ACE if ( $ ace [ 'mask' ] === 0 ) { continue ; } $ acl -> insertObjectAce ( $ ace [ 'sid' ] , $ ace [ 'mask' ] ) ; } $ this -> aclProvider -> updateAcl ( $ acl ) ; }
Update ACEs for entity
@param object $entity Entity to update ACL for
@param array  $aces   Array with ACEs (not Entry objects!)
@param string $type ACE type to update (object or class)
Update ACEs for entity