MutableAclInterface.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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 adds mutators for the AclInterface.
  13. *
  14. * All changes to Access Control Entries must go through this interface. Access
  15. * Control Entries must never be modified directly.
  16. *
  17. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  18. */
  19. interface MutableAclInterface extends AclInterface
  20. {
  21. /**
  22. * Deletes a class-based ACE.
  23. *
  24. * @param int $index
  25. */
  26. public function deleteClassAce($index);
  27. /**
  28. * Deletes a class-field-based ACE.
  29. *
  30. * @param int $index
  31. * @param string $field
  32. */
  33. public function deleteClassFieldAce($index, $field);
  34. /**
  35. * Deletes an object-based ACE.
  36. *
  37. * @param int $index
  38. */
  39. public function deleteObjectAce($index);
  40. /**
  41. * Deletes an object-field-based ACE.
  42. *
  43. * @param int $index
  44. * @param string $field
  45. */
  46. public function deleteObjectFieldAce($index, $field);
  47. /**
  48. * Returns the primary key of this ACL.
  49. *
  50. * @return int
  51. */
  52. public function getId();
  53. /**
  54. * Inserts a class-based ACE.
  55. *
  56. * @param SecurityIdentityInterface $sid
  57. * @param int $mask
  58. * @param int $index
  59. * @param bool $granting
  60. * @param string $strategy
  61. */
  62. public function insertClassAce(SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null);
  63. /**
  64. * Inserts a class-field-based ACE.
  65. *
  66. * @param string $field
  67. * @param SecurityIdentityInterface $sid
  68. * @param int $mask
  69. * @param int $index
  70. * @param bool $granting
  71. * @param string $strategy
  72. */
  73. public function insertClassFieldAce($field, SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null);
  74. /**
  75. * Inserts an object-based ACE.
  76. *
  77. * @param SecurityIdentityInterface $sid
  78. * @param int $mask
  79. * @param int $index
  80. * @param bool $granting
  81. * @param string $strategy
  82. */
  83. public function insertObjectAce(SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null);
  84. /**
  85. * Inserts an object-field-based ACE.
  86. *
  87. * @param string $field
  88. * @param SecurityIdentityInterface $sid
  89. * @param int $mask
  90. * @param int $index
  91. * @param bool $granting
  92. * @param string $strategy
  93. */
  94. public function insertObjectFieldAce($field, SecurityIdentityInterface $sid, $mask, $index = 0, $granting = true, $strategy = null);
  95. /**
  96. * Sets whether entries are inherited.
  97. *
  98. * @param bool $boolean
  99. */
  100. public function setEntriesInheriting($boolean);
  101. /**
  102. * Sets the parent ACL.
  103. *
  104. * @param AclInterface|null $acl
  105. */
  106. public function setParentAcl(AclInterface $acl = null);
  107. /**
  108. * Updates a class-based ACE.
  109. *
  110. * @param int $index
  111. * @param int $mask
  112. * @param string $strategy if null the strategy should not be changed
  113. */
  114. public function updateClassAce($index, $mask, $strategy = null);
  115. /**
  116. * Updates a class-field-based ACE.
  117. *
  118. * @param int $index
  119. * @param string $field
  120. * @param int $mask
  121. * @param string $strategy if null the strategy should not be changed
  122. */
  123. public function updateClassFieldAce($index, $field, $mask, $strategy = null);
  124. /**
  125. * Updates an object-based ACE.
  126. *
  127. * @param int $index
  128. * @param int $mask
  129. * @param string $strategy if null the strategy should not be changed
  130. */
  131. public function updateObjectAce($index, $mask, $strategy = null);
  132. /**
  133. * Updates an object-field-based ACE.
  134. *
  135. * @param int $index
  136. * @param string $field
  137. * @param int $mask
  138. * @param string $strategy if null the strategy should not be changed
  139. */
  140. public function updateObjectFieldAce($index, $field, $mask, $strategy = null);
  141. }