Is it possible to fix the security service class with a partial class?
I'm forced to add in exclude list because I have a function to check roles with a custom method.
My SecurityService.custom.cs is not an option without the partial class.
My own policy is Having one of roles from my own roles list is enough.
The supervisors are users & the users are readers.
I need set the user role only for the max level access.
From my SecurityService.Custom.cs
public partial class SecurityService
{*
private static ApplicationRole _appRoles = new ApplicationRole();*
public ApplicationRole AppRoles => _appRoles;*
public bool HasRoleAs(params string[] roles)*
{*
foreach (var role in roles)*
{*
if (IsInRole(role)) return true;*
}*
return false;*
}*
public bool IsAnonymous => User.Name == ApplicationRole.ANONYMOUS;*
public bool IsAdmin => User.Name == ApplicationRole.ADMIN;*
public bool IsSYSAdmin => HasRoleAs(AppRoles.SYSAdmins) || IsAdmin;*
public bool IsSYSSupervisor => HasRoleAs(AppRoles.SYSSupervisors);*
public bool IsSYSUser => HasRoleAs(AppRoles.SYSUsers);*
,,,
public bool CheckHasARoleAs(ComponentBase component, NavigationManager UriHelper)*