Skip to content

Commit

Permalink
Add role check
Browse files Browse the repository at this point in the history
  • Loading branch information
karlomikus committed Oct 1, 2023
1 parent 83d9bc8 commit 85c3cf5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Http/Controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function update(int $id, UserRequest $request): JsonResource

$user->name = $request->post('name');

if ($request->has('role_id')) {
if ($request->has('role_id') && $user->isBarAdmin(bar()->id)) {
$barMembership = $user->getBarMembership(bar()->id);
$barMembership->user_role_id = $request->post('role_id');
$barMembership->save();
Expand Down

0 comments on commit 85c3cf5

Please sign in to comment.