adjusted RequireRole middleware to be more cohesivie
This commit is contained in:
@@ -33,12 +33,10 @@ class RequireRole
|
||||
abort(403, "You don't any roles. You don't belong here.");
|
||||
}
|
||||
|
||||
if($ranking[$check[0]->role] >= $ranking[$role]) {
|
||||
$confirmed = true;
|
||||
if($ranking[$check[0]->role] < $ranking[$role]) {
|
||||
abort(403, "You don't have the correct role to be in this area.");
|
||||
}
|
||||
|
||||
abort_unless(auth()->check() && $confirmed, 403, "You don't have the correct role to be in this area.");
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user