Source for file IAuthorizator.php

Documentation is available at IAuthorizator.php

  1. 1: <?php
  2. 2:  
  3. 3: /**
  4. 4:  * Nette Framework
  5. 5:  *
  6. 6:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  7. 7:  * @license    http://nettephp.com/license  Nette license
  8. 8:  * @link       http://nettephp.com
  9. 9:  * @category   Nette
  10. 10:  * @package    Nette\Security
  11. 11:  */
  12. 12:  
  13. 13:  
  14. 14:  
  15. 15: /**
  16. 16:  * Authorizator checks if a given role has authorization
  17. 17:  * to access a given resource.
  18. 18:  *
  19. 19:  * @copyright  Copyright (c) 2004, 2010 David Grudl
  20. 20:  * @package    Nette\Security
  21. 21:  */
  22. 22: interface IAuthorizator
  23. 23: {
  24. 24:     /** Set type: all */
  25. 25:     const ALL NULL;
  26. 26:  
  27. 27:     /** Permission type: allow */
  28. 28:     const ALLOW TRUE;
  29. 29:  
  30. 30:     /** Permission type: deny */
  31. 31:     const DENY FALSE;
  32. 32:  
  33. 33:  
  34. 34:     /**
  35. 35:      * Performs a role-based authorization.
  36. 36:      * @param  string  role
  37. 37:      * @param  string  resource
  38. 38:      * @param  string  privilege
  39. 39:      * @return bool 
  40. 40:      */
  41. 41:     function isAllowed($role self::ALL$resource self::ALL$privilege self::ALL);
  42. 42:  
  43. 43: }