|
@@ -25,13 +25,11 @@ class CheckPermission
|
|
|
|
|
|
$permission=$this->RouteGetType($request,$permission);
|
|
|
|
|
|
- if (!Auth::user()->hasPermissionTo($permission)) {
|
|
|
-
|
|
|
- throw UnauthorizedException::forPermissions([$permission]);
|
|
|
+ if (Auth::user()->hasPermissionTo($permission)) {
|
|
|
+ return $next($request);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- return $next($request);
|
|
|
+ throw UnauthorizedException::forPermissions([$permission]);
|
|
|
}
|
|
|
|
|
|
public function RouteGetType(Request $request,string $permission){
|