diff --git a/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs b/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs index 76c04ef6283..a442f887f84 100644 --- a/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs +++ b/src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs @@ -467,6 +467,8 @@ public async Task AddToRoleAsync(IUser user, string normalizedRoleName, Cancella { throw new InvalidOperationException($"Role {normalizedRoleName} does not exist."); } + + u.RoleNames.Add(normalizedRoleName); } } @@ -485,6 +487,8 @@ public async Task RemoveFromRoleAsync(IUser user, string normalizedRoleName, Can { throw new InvalidOperationException($"Role {normalizedRoleName} does not exist."); } + + u.RoleNames.Remove(normalizedRoleName); } }