fix: 优化用户更新,超管问题
This commit is contained in:
@@ -145,11 +145,15 @@ namespace Yi.Framework.Rbac.Application.Services.System
|
||||
/// <returns></returns>
|
||||
[OperLog("更新用户", OperEnum.Update)]
|
||||
[Permission("system:user:edit")]
|
||||
public async override Task<UserGetOutputDto> UpdateAsync(Guid id, UserUpdateInputVo input)
|
||||
public override async Task<UserGetOutputDto> UpdateAsync(Guid id, UserUpdateInputVo input)
|
||||
{
|
||||
if (input.UserName == UserConst.Admin || input.UserName == UserConst.TenantAdmin)
|
||||
//不是超管,不能更新成超管
|
||||
if (!UserConst.Admin.Equals(CurrentUser.UserName))
|
||||
{
|
||||
throw new UserFriendlyException(UserConst.Name_Not_Allowed);
|
||||
if (input.UserName == UserConst.Admin || input.UserName == UserConst.TenantAdmin)
|
||||
{
|
||||
throw new UserFriendlyException(UserConst.Name_Not_Allowed);
|
||||
}
|
||||
}
|
||||
|
||||
if (await _repository.IsAnyAsync(u => input.UserName!.Equals(u.UserName) && !id.Equals(u.Id)))
|
||||
|
||||
Reference in New Issue
Block a user