mirror of
https://github.com/Deathgarden-Rebirth/Deathgarden_Rebirth-Rewrite.git
synced 2026-09-09 03:35:14 -05:00
Added permission check to bans page to only allow it when the user has the EDIT_USERS permission.
This commit is contained in:
@@ -101,6 +101,9 @@ public function reset(User $user)
|
||||
|
||||
public function bans(User $user)
|
||||
{
|
||||
if(!Auth::user()->can(Permissions::EDIT_USERS->value))
|
||||
abort(403, 'You are not allowed to edit Bans of a User.');
|
||||
|
||||
$bans = $user->bans;
|
||||
View::share('title', 'Bans for User: '.$user->id.'('.$user->last_known_username.')');
|
||||
|
||||
@@ -128,6 +131,9 @@ public function banPost(User $user, Ban $ban, BanPostRequest $request) {
|
||||
}
|
||||
|
||||
public function createBan(User $user) {
|
||||
if(!Auth::user()->can(Permissions::EDIT_USERS->value))
|
||||
abort(403, 'No Permission to create a Ban.');
|
||||
|
||||
$newBan = new Ban();
|
||||
$newBan->ban_reason = 'Placeholder';
|
||||
$newBan->start_date = Carbon::now()->addWeek();
|
||||
|
||||
Reference in New Issue
Block a user