Browse Source

Merge pull request #18590 from abpframework/IdentityOptions-Role

Set `IdentityOptions` when updating user role.
pull/18591/head
liangshiwei 2 years ago
committed by GitHub
parent
commit
6207a1437a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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)]
public virtual async Task UpdateRolesAsync(Guid id, IdentityUserUpdateRolesDto input)
{
await IdentityOptions.SetAsync();
var user = await UserManager.GetByIdAsync(id);
(await UserManager.SetRolesAsync(user, input.RoleNames)).CheckErrors();
await UserRepository.UpdateAsync(user);

Loading…
Cancel
Save