bugfix: updating a user when an admin (not a superuser) would remove any groups from the user. (#5914)
This commit is contained in:
@@ -247,9 +247,10 @@ class UsersController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
} catch (UserNotFoundException $e) {
|
||||
$error = trans('admin/users/message.user_not_found', compact('id'));
|
||||
return redirect()->route('users.index')->with('error', $error);
|
||||
|
||||
} catch (ModelNotFoundException $e) {
|
||||
return redirect()->route('users.index')
|
||||
->with('error', trans('admin/users/message.user_not_found', compact('id')))
|
||||
}
|
||||
|
||||
|
||||
@@ -257,8 +258,6 @@ class UsersController extends Controller
|
||||
if (Auth::user()->isSuperUser()) {
|
||||
if ($request->has('groups')) {
|
||||
$user->groups()->sync($request->input('groups'));
|
||||
} else {
|
||||
$user->groups()->sync(array());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user