Interface IContentPermissionAuthorizer
Authorizes content access.
Namespace: Umbraco.Cms.Core.Security.Authorization
Assembly: Umbraco.Core.dll
Syntax
public interface IContentPermissionAuthorizer
Methods
View SourceFilterAuthorizedAsync(IUser, IEnumerable<Guid>, ISet<string>)
Filters the specified content keys to only those the user has access to.
Declaration
Task<ISet<Guid>> FilterAuthorizedAsync(IUser currentUser, IEnumerable<Guid> contentKeys, ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| IEnumerable<Guid> | contentKeys | The keys of the content items to filter. |
| ISet<string> | permissionsToCheck | The collection of permissions to authorize. |
Returns
| Type | Description |
|---|---|
| Task<ISet<Guid>> | Returns the keys of content items the user has access to. |
Remarks
The default implementation falls back to calling IsDeniedAsync(IUser, IEnumerable<Guid>, ISet<string>) for each key individually. Override this method for better performance with batch authorization.
IsAuthorizedAtRootLevelAsync(IUser, string)
Authorizes whether the current user has access to the root item.
Declaration
Task<bool> IsAuthorizedAtRootLevelAsync(IUser currentUser, string permissionToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| string | permissionToCheck | The permission to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedAsync(IUser, IEnumerable<Guid>, ISet<string>)
Authorizes whether the current user has access to the specified content item(s).
Declaration
Task<bool> IsDeniedAsync(IUser currentUser, IEnumerable<Guid> contentKeys, ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| IEnumerable<Guid> | contentKeys | The keys of the content items to check for. |
| ISet<string> | permissionsToCheck | The collection of permissions to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedAsync(IUser, Guid, string)
Authorizes whether the current user has access to the specified content item.
Declaration
Task<bool> IsDeniedAsync(IUser currentUser, Guid contentKey, string permissionToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| Guid | contentKey | The key of the content item to check for. |
| string | permissionToCheck | The permission to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedAtRecycleBinLevelAsync(IUser, ISet<string>)
Authorizes whether the current user has access to the recycle bin item.
Declaration
Task<bool> IsDeniedAtRecycleBinLevelAsync(IUser currentUser, ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| ISet<string> | permissionsToCheck | The collection of permissions to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedAtRecycleBinLevelAsync(IUser, string)
Authorizes whether the current user has access to the recycle bin item.
Declaration
Task<bool> IsDeniedAtRecycleBinLevelAsync(IUser currentUser, string permissionToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user'. |
| string | permissionToCheck | The permission to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedAtRootLevelAsync(IUser, ISet<string>)
Authorizes whether the current user has access to the root item.
Declaration
Task<bool> IsDeniedAtRootLevelAsync(IUser currentUser, ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| ISet<string> | permissionsToCheck | The collection of permissions to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedForCultures(IUser, ISet<string>)
Authorizes whether the current user has access to the specified cultures.
Declaration
Task<bool> IsDeniedForCultures(IUser currentUser, ISet<string> culturesToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| ISet<string> | culturesToCheck | The collection of cultures to check access for. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedWithDescendantsAsync(IUser, Guid, ISet<string>)
Authorizes whether the current user has access to the descendants of the specified content item.
Declaration
Task<bool> IsDeniedWithDescendantsAsync(IUser currentUser, Guid parentKey, ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| Guid | parentKey | The key of the parent content item. |
| ISet<string> | permissionsToCheck | The collection of permissions to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |
IsDeniedWithDescendantsAsync(IUser, Guid, string)
Authorizes whether the current user has access to the descendants of the specified content item.
Declaration
Task<bool> IsDeniedWithDescendantsAsync(IUser currentUser, Guid parentKey, string permissionToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| IUser | currentUser | The current user. |
| Guid | parentKey | The key of the parent content item. |
| string | permissionToCheck | The permission to authorize. |
Returns
| Type | Description |
|---|---|
| Task<bool> | Returns |