2018-08-21 09:05:29 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use App\Models\User;
|
|
|
|
|
|
|
|
class CheckSuperAdmin
|
|
|
|
{
|
|
|
|
public function handle($request, Closure $next)
|
|
|
|
{
|
2019-03-31 11:00:07 +08:00
|
|
|
abort_if(auth()->user()->permission != User::SUPER_ADMIN, 403, trans('auth.check.super-admin'));
|
2019-04-19 19:36:36 +08:00
|
|
|
|
2018-08-21 09:05:29 +08:00
|
|
|
return $next($request);
|
|
|
|
}
|
|
|
|
}
|