src/acdhOeaw/fedora/acl/WebAcl.php
public function deleteAcl(): WebAcl {
        $fedora  = $this->res->getFedora();
        $resMeta = $this->res->getMetadata();
        $acls    = $resMeta->allResources(self::ACL_LINK_PROP);
        if (count($acls) == 0) {
            throw new NotFound();
        }
        foreach ($acls as $i) {
            $aclRes  = $fedora->getResourceByUri($i);
            $aclMeta = $aclRes->getMetadata();
            foreach ($aclMeta->allResources(self::ACL_CHILDREN_PROP) as $j) {
                $fedora->getResourceByUri($j->getUri())->delete();
            }
            $aclRes->getMetadata(true); // notify children were deleted
            $aclRes->delete(true, false);
        }
        $resMeta->deleteResource(self::ACL_LINK_PROP);
        $this->res->setMetadata($resMeta);
        $this->res->updateMetadata();

        $this->res->getAclUrl(true);
        $this->resRules = $this->extRules = [];

        return $this;
    }
public function deleteAcl(): WebAcl {
        $fedora  = $this->res->getFedora();
        $resMeta = $this->res->getMetadata();
        $acls    = $resMeta->allResources(self::ACL_LINK_PROP);
        if (count($acls) == 0) {
            throw new NotFound();
        }
        foreach ($acls as $i) {
            $aclRes  = $fedora->getResourceByUri($i);
            $aclMeta = $aclRes->getMetadata();
            foreach ($aclMeta->allResources(self::ACL_CHILDREN_PROP) as $j) {
                $fedora->getResourceByUri($j->getUri())->delete();
            }
            $aclRes->getMetadata(true); // notify children were deleted
            $aclRes->delete(true, false);
        }
        $resMeta->deleteResource(self::ACL_LINK_PROP);
        $this->res->setMetadata($resMeta);
        $this->res->updateMetadata();

        $this->res->getAclUrl(true);
        $this->resRules = $this->extRules = [];

        return $this;
    }
public function deleteAcl ( ) : WebAcl { $ fedora = $ this -> res -> getFedora ( ) ; $ resMeta = $ this -> res -> getMetadata ( ) ; $ acls = $ resMeta -> allResources ( self :: ACL_LINK_PROP ) ; if ( count ( $ acls ) == 0 ) { throw new NotFound ( ) ; } foreach ( $ acls as $ i ) { $ aclRes = $ fedora -> getResourceByUri ( $ i ) ; $ aclMeta = $ aclRes -> getMetadata ( ) ; foreach ( $ aclMeta -> allResources ( self :: ACL_CHILDREN_PROP ) as $ j ) { $ fedora -> getResourceByUri ( $ j -> getUri ( ) ) -> delete ( ) ; } $ aclRes -> getMetadata ( true ) ; // notify children were deleted $ aclRes -> delete ( true , false ) ; } $ resMeta -> deleteResource ( self :: ACL_LINK_PROP ) ; $ this -> res -> setMetadata ( $ resMeta ) ; $ this -> res -> updateMetadata ( ) ; $ this -> res -> getAclUrl ( true ) ; $ this -> resRules = $ this -> extRules = [ ] ; return $ this ; }
Removes ACL directly attached to this resource.
If there is no such ACL, error is thrown.
@return \acdhOeaw\fedora\acl\WebAcl
@throws NotFound
Removes ACL directly attached to this resource . If there is no such ACL error is thrown .