Conditions | 5 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function hasRole($roleName) |
||
23 | { |
||
24 | if(!self::check()){ |
||
|
|||
25 | return false; |
||
26 | } |
||
27 | $userRoles = UserDataAccess::getUserRoles(isset($_SESSION['user']['user_id']) ? $_SESSION['user']['user_id'] : 0); |
||
28 | $hasAccess = false; |
||
29 | foreach ($userRoles as $role){ |
||
30 | if($role->name == $roleName){ |
||
31 | $hasAccess = true; |
||
32 | break; |
||
33 | } |
||
34 | } |
||
35 | return $hasAccess; |
||
36 | } |
||
100 | } |