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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
0 deletions
-
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); |
|
|
|
|