3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-03-29 20:04:21 +00:00

Changed gate name, removed debugging

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe
2025-07-18 12:45:32 +01:00
parent 4f6e407247
commit ca4d3f6bce
4 changed files with 60 additions and 53 deletions

View File

@ -476,7 +476,8 @@ class UsersController extends Controller
return response()->json(Helper::formatStandardApiResponse('error', null, 'You cannot be your own manager'));
}
if (Gate::allows('canEditSensitiveFieldsForCurrentUser', $user)) {
// check for permissions related fields and pull them out if the current user cannot edit them
if (auth()->user()->can('editSensitiveUserFields') && auth()->user()->can('editableOnDemo')) {
if ($request->filled('password')) {
$user->password = bcrypt($request->input('password'));
@ -487,7 +488,11 @@ class UsersController extends Controller
}
if ($request->filled('email')) {
$user->username = $request->input('username');
$user->email = $request->input('email');
}
if ($request->filled('activated')) {
$user->activated = $request->input('activated');
}
}