Table of Contents

Interface IAuthorizationPolicy

Namespace
Excalibur.A3.Authorization
Assembly
Excalibur.A3.Abstractions.dll

Represents an authorization policy for validating user access to activities and resources.

public interface IAuthorizationPolicy : IPolicy
Extension Methods

Properties

TenantId

Gets the tenant identifier associated with the authorization policy.

string TenantId { get; }

Property Value

string

The tenant identifier.

UserId

Gets the user identifier associated with the authorization policy.

string? UserId { get; }

Property Value

string

The user identifier, or null if not available.

Methods

HasGrant(string)

Determines if the user has a grant for the specified activity.

bool HasGrant(string activityName)

Parameters

activityName string

The name of the activity to check for a grant.

Returns

bool

true if the user has a grant; otherwise, false .

HasGrant(string, string)

Determines if the user has a grant for a specific resource type and resource ID.

bool HasGrant(string resourceType, string resourceId)

Parameters

resourceType string

The type of the resource.

resourceId string

The identifier of the resource.

Returns

bool

true if the user has a grant; otherwise, false .

HasGrant<TActivity>()

Determines if the user has a grant for a specific activity type.

bool HasGrant<TActivity>()

Returns

bool

true if the user has a grant; otherwise, false .

Type Parameters

TActivity

The activity type to check for a grant.

HasGrant<TResourceType>(string)

Determines if the user has a grant for a specific resource type and resource ID.

bool HasGrant<TResourceType>(string resourceId)

Parameters

resourceId string

The identifier of the resource.

Returns

bool

true if the user has a grant; otherwise, false .

Type Parameters

TResourceType

The resource type to check.

IsAuthorized(string, string?)

Determines if the user is authorized to perform an activity on an optional resource.

bool IsAuthorized(string activityName, string? resourceId)

Parameters

activityName string

The name of the activity to authorize.

resourceId string

The identifier of the resource, or null if not applicable.

Returns

bool

true if the user is authorized; otherwise, false .