Fixed #6061 - Assigned user group cannot be removed

This bug was a result of attempting to check if the groups field had a value, and only THEN trying to sync the groups. This meant that uf you were removing ALL groups, the  sync wouldn’t be triggered.

This still needs to be updated in the API.
This commit is contained in:
snipe 2019-02-12 23:43:38 -08:00
parent 5e19178a30
commit f3c12f38b6

View file

@ -259,9 +259,7 @@ class UsersController extends Controller
// Only save groups if the user is a super user
if (Auth::user()->isSuperUser()) {
if ($request->has('groups')) {
$user->groups()->sync($request->input('groups'));
}
$user->groups()->sync($request->input('groups'));
}