RoleInterface.php 911 B

1234567891011121314151617181920212223242526272829303132333435
  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\Core\Role;
  11. /**
  12. * RoleInterface represents a role granted to a user.
  13. *
  14. * A role must either have a string representation or it needs to be explicitly
  15. * supported by at least one AccessDecisionManager.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. interface RoleInterface
  20. {
  21. /**
  22. * Returns the role.
  23. *
  24. * This method returns a string representation whenever possible.
  25. *
  26. * When the role cannot be represented with sufficient precision by a
  27. * string, it should return null.
  28. *
  29. * @return string|null A string representation of the role, or null
  30. */
  31. public function getRole();
  32. }