Conditions | 7 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function handle(Request $request, Closure $next) |
||
12 | { |
||
13 | if (config('twill.enabled.permissions-management') && !Auth::user()->isSuperAdmin()) { |
||
|
|||
14 | if (config('twill.support_subdomain_admin_routing') && $activeSubdomain = config('twill.active_subdomain')) { |
||
15 | foreach(Auth::user()->groups as $group) { |
||
16 | if (in_array($activeSubdomain, $group->subdomains_access)) { |
||
17 | return $next($request); |
||
18 | } |
||
19 | }; |
||
20 | abort(403); |
||
21 | } |
||
22 | } |
||
23 | return $next($request); |
||
24 | } |
||
26 |