Class SystemExecution

Namespace
Cratis.Arc.Authorization
Assembly
Cratis.Arc.Core.dll

Represents an implementation of ISystemExecution that establishes the server-side principal through the ICurrentPrincipalOverride.

public class SystemExecution : ISystemExecution
Inheritance
SystemExecution
Implements
Inherited Members
Extension Methods

Constructors

SystemExecution(ICurrentPrincipalOverride)

Represents an implementation of ISystemExecution that establishes the server-side principal through the ICurrentPrincipalOverride.

public SystemExecution(ICurrentPrincipalOverride currentPrincipalOverride)

Parameters

currentPrincipalOverride ICurrentPrincipalOverride

The ICurrentPrincipalOverride used to establish the server-side principal.

Methods

As(ClaimsPrincipal)

Establishes a scope that executes as the specified ClaimsPrincipal.

public IDisposable As(ClaimsPrincipal principal)

Parameters

principal ClaimsPrincipal

The ClaimsPrincipal to execute as.

Returns

IDisposable

An IDisposable that restores the previous execution context when disposed.

AsSystem(params string[])

Establishes a scope that executes as an authenticated system actor carrying the given roles.

public IDisposable AsSystem(params string[] roles)

Parameters

roles string[]

The roles the system actor holds. When empty, the actor satisfies AuthorizeAttribute but no RolesAttribute.

Returns

IDisposable

An IDisposable that restores the previous execution context when disposed.