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