public function insertOrUpdateClassAce($objectIdentity, $sid, $mask, $strategy = null)
    {
        $this->enforceObjectIdentity($objectIdentity);
        $this->enforceSecurityIdentity($sid);
        $mask = $this->resolveMask($mask, $objectIdentity);

        $acl = $this->getAcl($objectIdentity);

        $found = false;

        foreach ($acl->getClassAces() as $index => $ace) {
            if ($ace->getSecurityIdentity()->equals($sid)) {
                $acl->updateClassAce($index, $mask, $strategy);
                $found = true;
                break;
            }
        }

        if (false === $found) {
            $acl->insertClassAce($sid, $mask, 0, true, $strategy);
        }

        $this->securityContext->getACLProvider()->updateAcl($acl);

        return $this;
    }
public function insertOrUpdateClassAce($objectIdentity, $sid, $mask, $strategy = null)
    {
        $this->enforceObjectIdentity($objectIdentity);
        $this->enforceSecurityIdentity($sid);
        $mask = $this->resolveMask($mask, $objectIdentity);

        $acl = $this->getAcl($objectIdentity);

        $found = false;

        foreach ($acl->getClassAces() as $index => $ace) {
            if ($ace->getSecurityIdentity()->equals($sid)) {
                $acl->updateClassAce($index, $mask, $strategy);
                $found = true;
                break;
            }
        }

        if (false === $found) {
            $acl->insertClassAce($sid, $mask, 0, true, $strategy);
        }

        $this->securityContext->getACLProvider()->updateAcl($acl);

        return $this;
    }
public function insertOrUpdateClassAce ( $ objectIdentity , $ sid , $ mask , $ strategy = null ) { $ this -> enforceObjectIdentity ( $ objectIdentity ) ; $ this -> enforceSecurityIdentity ( $ sid ) ; $ mask = $ this -> resolveMask ( $ mask , $ objectIdentity ) ; $ acl = $ this -> getAcl ( $ objectIdentity ) ; $ found = false ; foreach ( $ acl -> getClassAces ( ) as $ index => $ ace ) { if ( $ ace -> getSecurityIdentity ( ) -> equals ( $ sid ) ) { $ acl -> updateClassAce ( $ index , $ mask , $ strategy ) ; $ found = true ; break ; } } if ( false === $ found ) { $ acl -> insertClassAce ( $ sid , $ mask , 0 , true , $ strategy ) ; } $ this -> securityContext -> getACLProvider ( ) -> updateAcl ( $ acl ) ; return $ this ; }
Updates an existing Class ACE, Inserts if it doesn't exist.

@param ObjectIdentityInterface|AbstractObjectIdentifiable $objectIdentity
@param SecurityIdentityInterface|UserSecurityIdentity $sid
@param int $mask
@param string|null $strategy
@return $this
Updates an existing Class ACE Inserts if it doesn t exist .