Browse Source

Set `IdentityOptions` when updating user role.

pull/18590/head
maliming 3 years ago
parent
commit
897b5d9ead
  1. 1
      modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

1
modules/identity/src/Volo.Abp.Identity.Application/Volo/Abp/Identity/IdentityUserAppService.cs

@ -140,6 +140,7 @@ public class IdentityUserAppService : IdentityAppServiceBase, IIdentityUserAppSe
[Authorize(IdentityPermissions.Users.Update)] [Authorize(IdentityPermissions.Users.Update)]
public virtual async Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input) public virtual async Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input)
{ {
await IdentityOptions.SetAsync();
var user = await UserManager.GetByIdAsync(id); var user = await UserManager.GetByIdAsync(id);
(await UserManager.SetRolesAsync(user, input.RoleNames)).CheckErrors(); (await UserManager.SetRolesAsync(user, input.RoleNames)).CheckErrors();
await UserRepository.UpdateAsync(user); await UserRepository.UpdateAsync(user);

Loading…
Cancel
Save