mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-12 03:06:43 +02:00
fix(users): remove required roles input when editing user + prevent owner's roles from being edited
fixes #239
This commit is contained in:
parent
7512e2ed1f
commit
1c8af7550b
5 changed files with 34 additions and 5 deletions
|
|
@ -143,6 +143,17 @@ class UserController extends BaseController
|
|||
$authorize = Services::authorization();
|
||||
|
||||
$roles = $this->request->getPost('roles');
|
||||
|
||||
if ($this->user->isOwner) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('errors', [
|
||||
lang('User.messages.editOwnerError', [
|
||||
'username' => $this->user->username,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
$authorize->setUserGroups($this->user->id, $roles ?? []);
|
||||
|
||||
// Success!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue