Add extension to ClaimsPrincipal

This commit is contained in:
2025-11-13 09:38:54 +09:00
parent 9bd8778e34
commit b5e5b0ecd2
7 changed files with 24 additions and 5 deletions

View File

@ -72,7 +72,7 @@
StateHasChanged();
var state = await AuthenticationStateProvider.GetAuthenticationStateAsync();
if (state.User.IsInRole(AppRole.ADMINISTRATOR_TYPE))
if (state.User.IsAdministrator())
{
currentUserId = state.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
usersWithRoles = await UsersService.GetUsersWithRoleAsync();