vendor/symfony/src/Symfony/Component/Security/Acl/Model/AclInterface.php
changeset 0 7f95f8617b0b
equal deleted inserted replaced
-1:000000000000 0:7f95f8617b0b
       
     1 <?php
       
     2 
       
     3 /*
       
     4  * This file is part of the Symfony package.
       
     5  *
       
     6  * (c) Fabien Potencier <fabien@symfony.com>
       
     7  *
       
     8  * For the full copyright and license information, please view the LICENSE
       
     9  * file that was distributed with this source code.
       
    10  */
       
    11 
       
    12 namespace Symfony\Component\Security\Acl\Model;
       
    13 
       
    14 /**
       
    15  * This interface represents an access control list (ACL) for a domain object.
       
    16  * Each domain object can have exactly one associated ACL.
       
    17  *
       
    18  * An ACL contains all access control entries (ACE) for a given domain object.
       
    19  * In order to avoid needing references to the domain object itself, implementations
       
    20  * use ObjectIdentity implementations as an additional level of indirection.
       
    21  *
       
    22  * @author Johannes M. Schmitt <schmittjoh@gmail.com>
       
    23  */
       
    24 interface AclInterface extends \Serializable
       
    25 {
       
    26     /**
       
    27      * Returns all class-based ACEs associated with this ACL
       
    28      *
       
    29      * @return array
       
    30      */
       
    31     function getClassAces();
       
    32 
       
    33     /**
       
    34      * Returns all class-field-based ACEs associated with this ACL
       
    35      *
       
    36      * @param string $field
       
    37      * @return array
       
    38      */
       
    39     function getClassFieldAces($field);
       
    40 
       
    41     /**
       
    42      * Returns all object-based ACEs associated with this ACL
       
    43      *
       
    44      * @return array
       
    45      */
       
    46     function getObjectAces();
       
    47 
       
    48     /**
       
    49      * Returns all object-field-based ACEs associated with this ACL
       
    50      *
       
    51      * @param string $field
       
    52      * @return array
       
    53      */
       
    54     function getObjectFieldAces($field);
       
    55 
       
    56     /**
       
    57      * Returns the object identity associated with this ACL
       
    58      *
       
    59      * @return ObjectIdentityInterface
       
    60      */
       
    61     function getObjectIdentity();
       
    62 
       
    63     /**
       
    64      * Returns the parent ACL, or null if there is none.
       
    65      *
       
    66      * @return AclInterface|null
       
    67      */
       
    68     function getParentAcl();
       
    69 
       
    70     /**
       
    71      * Whether this ACL is inheriting ACEs from a parent ACL.
       
    72      *
       
    73      * @return Boolean
       
    74      */
       
    75     function isEntriesInheriting();
       
    76 
       
    77     /**
       
    78      * Determines whether field access is granted
       
    79      *
       
    80      * @param string  $field
       
    81      * @param array   $masks
       
    82      * @param array   $securityIdentities
       
    83      * @param Boolean $administrativeMode
       
    84      * @return Boolean
       
    85      */
       
    86     function isFieldGranted($field, array $masks, array $securityIdentities, $administrativeMode = false);
       
    87 
       
    88     /**
       
    89      * Determines whether access is granted
       
    90      *
       
    91      * @throws NoAceFoundException when no ACE was applicable for this request
       
    92      * @param array   $masks
       
    93      * @param array   $securityIdentities
       
    94      * @param Boolean $administrativeMode
       
    95      * @return Boolean
       
    96      */
       
    97     function isGranted(array $masks, array $securityIdentities, $administrativeMode = false);
       
    98 
       
    99     /**
       
   100      * Whether the ACL has loaded ACEs for all of the passed security identities
       
   101      *
       
   102      * @param mixed $securityIdentities an implementation of SecurityIdentityInterface, or an array thereof
       
   103      * @return Boolean
       
   104      */
       
   105     function isSidLoaded($securityIdentities);
       
   106 }