| Conditions | 6 |
| Paths | 6 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | private static function loadAllowRoles($dashboardName) |
||
| 49 | { |
||
| 50 | |||
| 51 | if (!$panels = Module::getInstance()->dashboards) { |
||
| 52 | return []; |
||
| 53 | } |
||
| 54 | if (!isset($panels[$dashboardName])) { |
||
| 55 | return []; |
||
| 56 | } |
||
| 57 | if (!is_array($panels[$dashboardName])) { |
||
| 58 | return []; |
||
| 59 | } |
||
| 60 | if (!isset($panels[$dashboardName]['allowRoles'])) { |
||
| 61 | return []; |
||
| 62 | } |
||
| 63 | |||
| 64 | $viewRoles = $panels[$dashboardName]['allowRoles']; |
||
| 65 | |||
| 66 | if ($updateRoles = Module::getInstance()->updateRoles) { |
||
| 67 | $viewRoles = array_merge($updateRoles, $viewRoles); |
||
| 68 | } |
||
| 69 | |||
| 70 | return $viewRoles; |
||
| 71 | } |
||
| 72 | } |
||
| 73 |