Class ClaimsAuthorisation
public class ClaimsAuthorisation : IAuthorisation
- Inheritance
-
ClaimsAuthorisation
- Implements
- Derived
- Inherited Members
Fields
ADMIN_ROLE
public const string ADMIN_ROLE = "admin"
Field Value
ROLE_KEY
public const string ROLE_KEY = "role"
Field Value
Methods
AddRoleAsync(IUserAccount, string, CancellationToken?)
public static Task AddRoleAsync(IUserAccount account, string name, CancellationToken? cancellationToken = null)
Parameters
accountIUserAccountnamestringcancellationTokenCancellationToken?
Returns
GetDefaultPermissions(CallbackEnvironment)
The rights assigned to all users regardless of their roles.
public virtual PermissionSet GetDefaultPermissions(CallbackEnvironment environment)
Parameters
environmentCallbackEnvironment
Returns
GetIdentityRolesAsync(CallbackEnvironment, IEntityContext, Identity)
The roles assigned to a user.
public Task<IReadOnlySet<Role>> GetIdentityRolesAsync(CallbackEnvironment environment, IEntityContext scopedContext, Identity subject)
Parameters
environmentCallbackEnvironmentscopedContextIEntityContextsubjectIdentity
Returns
GetRolePermissions(CallbackEnvironment, Role)
The rights assigned to a role (which may be in turn be assigned to users or groups).
public virtual PermissionSet GetRolePermissions(CallbackEnvironment environment, Role role)
Parameters
environmentCallbackEnvironmentroleRole
Returns
IsAdmin(IUserAccount)
public static bool IsAdmin(IUserAccount account)
Parameters
accountIUserAccount
Returns
IsAdminAsync(IUserAccount, CancellationToken?)
public static Task<bool> IsAdminAsync(IUserAccount account, CancellationToken? cancellationToken = null)
Parameters
accountIUserAccountcancellationTokenCancellationToken?
Returns
RemoveRoleAsync(IUserAccount, string, CancellationToken?)
public static Task RemoveRoleAsync(IUserAccount account, string name, CancellationToken? cancellationToken = null)
Parameters
accountIUserAccountnamestringcancellationTokenCancellationToken?
Returns
SetAdminAsync(IUserAccount, bool, CancellationToken?)
public static Task SetAdminAsync(IUserAccount account, bool isAdmin, CancellationToken? cancellationToken = null)
Parameters
accountIUserAccountisAdminboolcancellationTokenCancellationToken?