fix(permissions): remove direct user permission sync — roles only
UpdateUserAction and CreateUserAction were calling syncPermissions() which wrote to model_has_permissions table directly. This meant permissions persisted even after being removed from the role. Now users only get permissions through their roles.
This commit is contained in:
@@ -19,11 +19,6 @@ class CreateUserAction
|
||||
$user->syncRoles($data['roles']);
|
||||
}
|
||||
|
||||
// Назначение разрешений если переданы
|
||||
if (isset($data['permissions']) && is_array($data['permissions'])) {
|
||||
$user->syncPermissions($data['permissions']);
|
||||
}
|
||||
|
||||
return $user->load(['roles', 'permissions']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user