Interface IBackOfficeSecurityAccessor
Provides access to the IBackOfficeSecurity instance for the current request or ambient async context.
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Core.dll
Syntax
public interface IBackOfficeSecurityAccessor
Properties
View SourceBackOfficeSecurity
Gets the IBackOfficeSecurity instance for the current request or async context.
Declaration
IBackOfficeSecurity? BackOfficeSecurity { get; }
Property Value
| Type | Description |
|---|---|
| IBackOfficeSecurity |
Methods
View SourceOverride(IBackOfficeSecurity)
Sets an ambient IBackOfficeSecurity override for the current async flow. The override takes precedence over the HTTP-context-based resolution for the lifetime of the returned scope. Disposing the scope clears the override.
Declaration
IDisposable Override(IBackOfficeSecurity backOfficeSecurity)
Parameters
| Type | Name | Description |
|---|---|---|
| IBackOfficeSecurity | backOfficeSecurity | The identity to use for the duration of the scope. |
Returns
| Type | Description |
|---|---|
| IDisposable | An System.IDisposable that clears the override when disposed. |
Remarks
This is intended for background processing scenarios where no HTTP context is available but CMS code still needs a backoffice identity.