From b932db34ccaca40720f7157f8d5c35db443217cd Mon Sep 17 00:00:00 2001 From: xiang <27800734@qq.com> Date: Sun, 11 May 2025 00:26:20 +0800 Subject: [PATCH] 1 --- Yes.Application/Admins/Users/UpdateUserCommandHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Yes.Application/Admins/Users/UpdateUserCommandHandler.cs b/Yes.Application/Admins/Users/UpdateUserCommandHandler.cs index dafc391..90603b9 100644 --- a/Yes.Application/Admins/Users/UpdateUserCommandHandler.cs +++ b/Yes.Application/Admins/Users/UpdateUserCommandHandler.cs @@ -31,6 +31,12 @@ { throw new UserNotExistsException(request.Id); } + if (user.IsSystemUser()) + { + throw new AccessDeniedException(); + } + + user.Update(request.Name, request.Email, request.NickName, request.Password); _db.Users.Update(user); await _db.SaveChangesAsync();