Conditions | 4 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.1755 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | 2 | public function getRoleList($limit = true) |
|
14 | { |
||
15 | 2 | $roles = (UserRoleType::all()); |
|
16 | |||
17 | 2 | if($limit) |
|
18 | { |
||
19 | 2 | if(Auth::user()->role_id !== 1) |
|
20 | { |
||
21 | $roles->forget(0); |
||
22 | } |
||
23 | |||
24 | 2 | if(Auth::user()->role_id > 2) |
|
25 | { |
||
26 | $roles->forget(1); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | 2 | Log::debug('Role list gathered. Data - ', $roles->toArray()); |
|
31 | 2 | return $roles; |
|
32 | } |
||
34 |