NullPermissionManager.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
11 namespace wcmf\lib\security\impl;
12 
14 
15 /**
16  * NullPermissionManager acts like an absent PermissionManager.
17  *
18  * @author ingo herwig <ingo@wemove.com>
19  */
21 
22  private static $_policies = array(
23  'allow' => array(),
24  'deny' => array(),
25  'default' => true
26  );
27 
28  /**
29  * @see PermissionManager::getPermissions()
30  */
31  public function getPermissions($resource, $context, $action) {
32  return self::$_policies;
33  }
34 
35  /**
36  * @see PermissionManager::setPermissions()
37  */
38  public function setPermissions($resource, $context, $action, $permissions) {
39  }
40 
41  /**
42  * @see PermissionManager::createPermission()
43  */
44  public function createPermission($resource, $context, $action, $role, $modifier) {
45  return false;
46  }
47 
48  /**
49  * @see PermissionManager::removePermission()
50  */
51  public function removePermission($resource, $context, $action, $role) {
52  return false;
53  }
54 }
55 ?>
removePermission($resource, $context, $action, $role)
setPermissions($resource, $context, $action, $permissions)
AbstractPermissionManager is the base class for concrete PermissionManager implementations.
createPermission($resource, $context, $action, $role, $modifier)
NullPermissionManager acts like an absent PermissionManager.
PermissionManager implementations are used to handle all authorization requests.