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