Skip to content

Commit

Permalink
Fix UserStore by saving/removing the role from the user (#13066)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAlhayek authored Jan 10, 2023
1 parent bcba76a commit aa631dd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/OrchardCore/OrchardCore.Users.Core/Services/UserStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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);
}
}

Expand Down

0 comments on commit aa631dd

Please sign in to comment.