Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
48 | public function has(IPermission $permission) { |
||
49 | $role = new GuestRole(); |
||
50 | |||
51 | $permissionReflection = new \ReflectionObject($permission); |
||
52 | |||
53 | if ($permissionReflection->hasMethod('checkForGuestRole')) { // If a method exists for the roleName... |
||
54 | // Gets the method. |
||
55 | $method = $permissionReflection->getMethod('checkForGuestRole'); |
||
56 | |||
57 | $permission->setRole($role); |
||
58 | |||
59 | // Invokes the method. |
||
60 | return $method->invoke($permission); |
||
61 | } |
||
62 | else |
||
63 | return FALSE; |
||
64 | } |
||
94 | } |