Conditions | 4 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.1755 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
28 | 1 | protected function isValidRole($action,$role) { |
|
29 | 1 | $controller=\get_class($this); |
|
30 | 1 | $resourceController = AclManager::getPermissionMap ()->getRessourcePermission ( $controller, $action ); |
|
31 | 1 | if (isset ( $resourceController )) { |
|
32 | try{ |
||
33 | 1 | if (AclManager::isAllowed ( $role, $resourceController ['resource'], $resourceController ['permission'] )) { |
|
34 | 1 | return true; |
|
35 | } |
||
36 | } |
||
37 | catch(AclException $e){ |
||
38 | Logger::alert('Router', $role.' is not allowed for this resource','Acls',[$controller,$action]); |
||
39 | } |
||
40 | } |
||
41 | 1 | return false; |
|
42 | } |
||
55 |