PermissionMapInterface.php 1022 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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\Permission;
  11. /**
  12. * This is the interface that must be implemented by permission maps.
  13. *
  14. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  15. */
  16. interface PermissionMapInterface
  17. {
  18. /**
  19. * Returns an array of bitmasks.
  20. *
  21. * The security identity must have been granted access to at least one of
  22. * these bitmasks.
  23. *
  24. * @param string $permission
  25. * @param object $object
  26. *
  27. * @return array may return null if permission/object combination is not supported
  28. */
  29. public function getMasks($permission, $object);
  30. /**
  31. * Whether this map contains the given permission.
  32. *
  33. * @param string $permission
  34. *
  35. * @return bool
  36. */
  37. public function contains($permission);
  38. }