Table of Contents

Interface IAuthorization

Namespace
Arc4u.Security.Principal
Assembly
Arc4u.dll

The interface defines the authorization pattern used to check if a user is able to do an operation or not. The methods are based on Azman and Role base model See msdn for azman documentation.

public interface IAuthorization

Properties

AuthorizationType

Gets the type of the authorization.

string AuthorizationType { get; }

Property Value

string

The type of the authorization.

Methods

IsAuthorized(params int[])

Determines whether the specified operations are authorized.

bool IsAuthorized(params int[] operations)

Parameters

operations int[]

The operations.

Returns

bool

true if the specified operations is authorized; otherwise, false.

IsAuthorized(string)

Determines whether the specified operation is authorized in the default (empty) scope.

bool IsAuthorized(string operation)

Parameters

operation string

The operation name.

Returns

bool

true if the specified operation is authorized; otherwise, false.

Remarks

This overload exists so that IsAuthorized("Name") compiles: without it, a single string argument matches both IsAuthorized(string, params int[]) and IsAuthorized(string, params string[]) with an empty operations array, which is ambiguous.

IsAuthorized(string, params int[])

Determines whether the specified operations are authorized in the specified scope.

bool IsAuthorized(string scope, params int[] operations)

Parameters

scope string

The scope.

operations int[]

The operations.

Returns

bool

true if the specified scope is authorized; otherwise, false.

IsAuthorized(string, params string[])

Determines whether the specified operations are authorized in the specified scope.

bool IsAuthorized(string scope, params string[] operations)

Parameters

scope string

The scope.

operations string[]

The operations.

Returns

bool

true if the specified scope is authorized; otherwise, false.

IsAuthorized(params string[])

Determines whether the specified operations are authorized.

bool IsAuthorized(params string[] operations)

Parameters

operations string[]

The operations.

Returns

bool

true if the specified operations is authorized; otherwise, false.

IsInRole(string)

Determines whether the user is defined in the specified role.

bool IsInRole(string role)

Parameters

role string

The role.

Returns

bool

true if [is in role] [the specified role]; otherwise, false.

IsInRole(string, string)

/// Determines whether the user is defined in the specified role for the specific scope.

bool IsInRole(string scope, string role)

Parameters

scope string

The scope.

role string

The role.

Returns

bool

true if [is in role] [the specified scope]; otherwise, false.

Operations()

Operations defined.

string[] Operations()

Returns

string[]

Operations(string)

Operations defined in the specified scope.

string[] Operations(string scope)

Parameters

scope string

The scope.

Returns

string[]

Roles()

Roleses defined.

string[] Roles()

Returns

string[]

Roles(string)

Roleses defined in the specified scope.

string[] Roles(string scope)

Parameters

scope string

The scope.

Returns

string[]

Scopes()

Scopeses for roles and operations.

string[] Scopes()

Returns

string[]