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 (c) 2004, 2009 David Grudl (http://davidgrudl.com)
  7. 7:  *
  8. 8:  * This source file is subject to the "Nette license" that is bundled
  9. 9:  * with this package in the file license.txt.
  10. 10:  *
  11. 11:  * For more information please see https://nette.org
  12. 12:  *
  13. 13:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  14. 14:  * @license    https://nette.org/license  Nette license
  15. 15:  * @link       https://nette.org
  16. 16:  * @category   Nette
  17. 17:  * @package    Nette\Security
  18. 18:  * @version    $Id$
  19. 19:  */
  20. 20:  
  21. 21:  
  22. 22:  
  23. 23: /**
  24. 24:  * Authorizator checks if a given role has authorization
  25. 25:  * to access a given resource.
  26. 26:  *
  27. 27:  * @author     David Grudl
  28. 28:  * @copyright  Copyright (c) 2004, 2009 David Grudl
  29. 29:  * @package    Nette\Security
  30. 30:  */
  31. 31: interface IAuthorizator
  32. 32: {
  33. 33:     /** Set type: all */
  34. 34:     const ALL NULL;
  35. 35:  
  36. 36:     /** Permission type: allow */
  37. 37:     const ALLOW TRUE;
  38. 38:  
  39. 39:     /** Permission type: deny */
  40. 40:     const DENY FALSE;
  41. 41:  
  42. 42:  
  43. 43:     /**
  44. 44:      * Performs a role-based authorization.
  45. 45:      * @param  string  role
  46. 46:      * @param  string  resource
  47. 47:      * @param  string  privilege
  48. 48:      * @return bool 
  49. 49:      */
  50. 50:     function isAllowed($role self::ALL$resource self::ALL$privilege self::ALL);
  51. 51:  
  52. 52: }