Interface IConsentService
A service for handling lawful data processing requirements
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IConsentService : IService
Remarks
Consent can be given or revoked or changed via the RegisterConsent(string, string, string, ConsentState, string?) method, which creates a new IConsent entity to track the consent. Revoking a consent is performed by registering a revoked consent.
A consent can be revoked, by registering a revoked consent, but cannot be deleted.
Getter methods return the current state of a consent, i.e. the latest IConsent entity that was created.
Methods
View SourceLookupConsent(string?, string?, string?, bool, bool, bool, bool)
Retrieves consents.
Declaration
IEnumerable<IConsent> LookupConsent(string? source = null, string? context = null, string? action = null, bool sourceStartsWith = false, bool contextStartsWith = false, bool actionStartsWith = false, bool includeHistory = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | source | The optional source. |
| string | context | The optional context. |
| string | action | The optional action. |
| bool | sourceStartsWith | Determines whether |
| bool | contextStartsWith | Determines whether |
| bool | actionStartsWith | Determines whether |
| bool | includeHistory | Determines whether to include the history of consents. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IConsent> | Consents matching the parameters. |
RegisterConsent(string, string, string, ConsentState, string?)
Registers consent.
Declaration
IConsent RegisterConsent(string source, string context, string action, ConsentState state, string? comment = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | source | The source, i.e. whoever is consenting. |
| string | context | |
| string | action | |
| ConsentState | state | The state of the consent. |
| string | comment | Additional free text. |
Returns
| Type | Description |
|---|---|
| IConsent | The corresponding consent entity. |