Table of Contents

Class ClaimsAuthorisation

Namespace
The.Security
Assembly
Instagile.dll
public class ClaimsAuthorisation : IAuthorisation
Inheritance
ClaimsAuthorisation
Implements
Derived
Inherited Members

Fields

ADMIN_ROLE

public const string ADMIN_ROLE = "admin"

Field Value

string

ROLE_KEY

public const string ROLE_KEY = "role"

Field Value

string

Methods

AddRoleAsync(IUserAccount, string, CancellationToken?)

public static Task AddRoleAsync(IUserAccount account, string name, CancellationToken? cancellationToken = null)

Parameters

account IUserAccount
name string
cancellationToken CancellationToken?

Returns

Task

GetDefaultPermissions(CallbackEnvironment)

The rights assigned to all users regardless of their roles.

public virtual PermissionSet GetDefaultPermissions(CallbackEnvironment environment)

Parameters

environment CallbackEnvironment

Returns

PermissionSet

GetIdentityRolesAsync(CallbackEnvironment, IEntityContext, Identity)

The roles assigned to a user.

public Task<IReadOnlySet<Role>> GetIdentityRolesAsync(CallbackEnvironment environment, IEntityContext scopedContext, Identity subject)

Parameters

environment CallbackEnvironment
scopedContext IEntityContext
subject Identity

Returns

Task<IReadOnlySet<Role>>

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

environment CallbackEnvironment
role Role

Returns

PermissionSet

IsAdmin(IUserAccount)

public static bool IsAdmin(IUserAccount account)

Parameters

account IUserAccount

Returns

bool

IsAdminAsync(IUserAccount, CancellationToken?)

public static Task<bool> IsAdminAsync(IUserAccount account, CancellationToken? cancellationToken = null)

Parameters

account IUserAccount
cancellationToken CancellationToken?

Returns

Task<bool>

RemoveRoleAsync(IUserAccount, string, CancellationToken?)

public static Task RemoveRoleAsync(IUserAccount account, string name, CancellationToken? cancellationToken = null)

Parameters

account IUserAccount
name string
cancellationToken CancellationToken?

Returns

Task

SetAdminAsync(IUserAccount, bool, CancellationToken?)

public static Task SetAdminAsync(IUserAccount account, bool isAdmin, CancellationToken? cancellationToken = null)

Parameters

account IUserAccount
isAdmin bool
cancellationToken CancellationToken?

Returns

Task