Class AuthorizationService
Provides authorization and authentication state management for the UI.
Inherited Members
Namespace: OEMS.UI.Auth
Assembly: OEMS.UI.dll
Syntax
public class AuthorizationService
Constructors
AuthorizationService(AuthenticationStateProvider)
Initializes a new instance of the AuthorizationService class.
Declaration
public AuthorizationService(AuthenticationStateProvider authStateProvider)
Parameters
Type | Name | Description |
---|---|---|
AuthenticationStateProvider | authStateProvider | The authentication state provider for retrieving user authentication information. |
Methods
CanManageTemplatesInAnyOrganizationAsync()
Determines if the current user is an OrgAdmin, Organizer, or Designer in any organization
Declaration
public Task<bool> CanManageTemplatesInAnyOrganizationAsync()
Returns
Type | Description |
---|---|
Task<bool> |
CanManageTemplatesInOrganizationAsync(Guid)
Determines if the current user is an OrgAdmin, Organizer, or Designer in a specific organization
Declaration
public Task<bool> CanManageTemplatesInOrganizationAsync(Guid organizationId)
Parameters
Type | Name | Description |
---|---|---|
Guid | organizationId |
Returns
Type | Description |
---|---|
Task<bool> |
GetAuthenticationStateProvider()
Gets the authentication state provider instance.
Declaration
public AuthenticationStateProvider GetAuthenticationStateProvider()
Returns
Type | Description |
---|---|
AuthenticationStateProvider | The authentication state provider used by this service. |
GetCurrentUserIdAsync()
Gets the current user's ID
Declaration
public Task<Guid?> GetCurrentUserIdAsync()
Returns
Type | Description |
---|---|
Task<Guid?> |
HasRoleInAnyOrganizationAsync(string)
Determines if the current user has a specified role in any organization
Declaration
public Task<bool> HasRoleInAnyOrganizationAsync(string role)
Parameters
Type | Name | Description |
---|---|---|
string | role |
Returns
Type | Description |
---|---|
Task<bool> |
HasRoleInOrganizationAsync(Guid, string)
Determines if the current user has a specified role in a particular organization
Declaration
public Task<bool> HasRoleInOrganizationAsync(Guid organizationId, string role)
Parameters
Type | Name | Description |
---|---|---|
Guid | organizationId | |
string | role |
Returns
Type | Description |
---|---|
Task<bool> |
IsAdminAsync()
Determines if the current user has the system admin role
Declaration
public Task<bool> IsAdminAsync()
Returns
Type | Description |
---|---|
Task<bool> |
IsAuthenticatedAsync()
Determines if the current user is authenticated
Declaration
public Task<bool> IsAuthenticatedAsync()
Returns
Type | Description |
---|---|
Task<bool> |