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