Can't remove your own admin rights.

This commit is contained in:
James Cole 2020-03-24 05:57:04 +01:00
parent 87b62e2e72
commit db3c9fbd28
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -189,7 +189,7 @@ class UserController extends Controller
$this->repository->attachRole($user, 'owner');
session()->flash('info', trans('firefly.give_admin_careful'));
}
if (false === $data['is_owner']) {
if (false === $data['is_owner'] && $user->id !== auth()->user()->id) {
$this->repository->removeRole($user, 'owner');
}