AclInterface.php 2.9 KB

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