Commit d0de62e0 authored by Nicolas Widart's avatar Nicolas Widart

Fix the user update method

parent 5efbec0c
......@@ -74,12 +74,12 @@ class SentryUserRepository implements UserRepository
public function updateAndSyncRoles($userId, $data, $roles)
{
$user = Sentry::findUserById($userId);
$user = $user->update($data);
$user->save();
$user->update($data);
if (!empty($roles)) {
$adminGroup = Sentry::findGroupByName($roles);
$user->removeGroup();
$user->addGroup($adminGroup);
foreach ($roles as $roleId) {
$group = Sentry::findGroupById($roleId);
$user->addGroup($group);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment