phpcr/src/PHPCR/Security/AccessControlListInterface.php

Show: PublicProtectedPrivateinherited
    Table of Contents
    This file is part of the PHPCR API and was originally ported from the Java JCR API to PHP by Karsten Dambekalns for the FLOW3 project.

    Copyright 2008-2011 Karsten Dambekalns karsten@typo3.org

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0
    

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

    License
    Apache Software License 2.0  
    Link
    http://phpcr.github.com/  

    \PHPCR\Security\AccessControlListInterface

    Package: Default
    The AccessControlListInterface is an AccessControlPolicyInterface representing a list of access control entries.

    It is mutable before being set to the AccessControlManagerInterface and consequently defines methods to read and mutate the list i.e. to get, add or remove individual AccessControlEntryInterface instances.

    The \Traversable interface enables the implementation to be addressed with foreach. AccessControlList has to implement either \RecursiveIterator or \Iterator. The iterator is equivalent to getAccessControlEntries() returning AccessControlEntryInterface instances. The iterator keys have no significant meaning.

    Parent(s)
    \PHPCR\Security\AccessControlPolicyInterface
    Api
     

    Methods

    methodpublicaddAccessControlEntry(\PHPCR\Security\PrincipalInterface $principal, array $privileges) : boolean

    Registers an access control entry object to the registry.

    Adds an access control entry to this policy consisting of the specified principal and the specified privileges. This method returns true if this policy was modified, false otherwise.

    How the entries are grouped within the list is an implementation detail. An implementation may e.g. combine the specified privileges with those added by a previous call to addAccessControlEntry for the same Principal. However, a call to addAccessControlEntry for a given Principal can never remove a Privilege added by a previous call.

    The modification does not take effect until this policy has been set to a node by calling AccessControlManagerInterface::setPolicy() and Session::save is performed.

    Parameters
    NameTypeDescription
    $principal\PHPCR\Security\PrincipalInterface

    the entity that should have this privilege

    $privilegesarray
    • an array of Privileges.
    Returns
    TypeDescription
    booleantrue if this policy was modify; false otherwise.
    Throws
    ExceptionDescription
    \PHPCR\Security\AccessControlExceptionif the specified principal or any of the privileges does not exist or if some other access control related exception occurs.
    \PHPCR\RepositoryException- if another error occurs.
    Details
    Api
     
    methodpublicgetAccessControlEntries() : array

    Returns all access control entries present with this policy.

    This method is only guaranteed to return an access control entry object if that access control entry object has been assigned through this API.

    Returns
    TypeDescription
    arrayall AccessControlEntry objects present with this policy.
    Throws
    ExceptionDescription
    \PHPCR\RepositoryException- if an error occurs.
    Details
    Api
     
    methodpublicremoveAccessControlEntry(\PHPCR\Security\AccessControlEntryInterface $ace) : void

    Removes the specified access control entry object from this policy.

    Only exactly those entries obtained through getAccessControlEntries can be removed. This method does not take effect until this policy has been re-assigned to a node by calling AccessControlManagerInterface::setPolicy() and save is performed.

    Parameters
    NameTypeDescription
    $ace\PHPCR\Security\AccessControlEntryInterface

    the access control entry to be removed.

    Throws
    ExceptionDescription
    \PHPCR\Security\AccessControlExceptionif the specified entry is not present on the specified node.
    \PHPCR\RepositoryExceptionif another error occurs.
    Details
    Api
     
    Documentation was generated by phpDocumentor 2.0.0a12.