@@ 66-80 (lines=15) @@ | ||
63 | * |
|
64 | * @return array |
|
65 | */ |
|
66 | private function hasAnyPermissionAccess($user) |
|
67 | { |
|
68 | if (!array_key_exists('permissions', $this->access) || !$this->access['permissions']) { |
|
69 | return []; |
|
70 | } |
|
71 | ||
72 | $permissions = explode('|', $this->access['permissions']); |
|
73 | ||
74 | $hasAccess = array_map(function ($permission) use ($user) { |
|
75 | // Note: internal return |
|
76 | return $user->hasPermissionTo($permission); |
|
77 | }, $permissions); |
|
78 | ||
79 | return $hasAccess; |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * @param $user |
|
@@ 87-101 (lines=15) @@ | ||
84 | * |
|
85 | * @return array |
|
86 | */ |
|
87 | private function hasAnyRoleAccess($user) |
|
88 | { |
|
89 | if (!array_key_exists('roles', $this->access) || !$this->access['roles']) { |
|
90 | return []; |
|
91 | } |
|
92 | ||
93 | $roles = explode('|', $this->access['roles']); |
|
94 | ||
95 | $hasAccess = array_map(function ($role) use ($user) { |
|
96 | // Note: internal return |
|
97 | return $user->hasRole($role); |
|
98 | }, $roles); |
|
99 | ||
100 | return $hasAccess; |
|
101 | } |
|
102 | } |
|
103 |