Class ElementPermissionResource
A resource used for the ElementPermissionHandler.
Inheritance
Namespace: Umbraco.Cms.Core.Security.Authorization
Assembly: Umbraco.Core.dll
Syntax
public class ElementPermissionResource : IPermissionResource
Properties
View SourceCheckRecycleBin
Gets a value indicating whether to check for the recycle bin.
Declaration
public bool CheckRecycleBin { get; }
Property Value
| Type | Description |
|---|---|
| bool |
CheckRoot
Gets a value indicating whether to check for the root.
Declaration
public bool CheckRoot { get; }
Property Value
| Type | Description |
|---|---|
| bool |
CulturesToCheck
All the cultures need to be accessible when evaluating
Declaration
public ISet<string>? CulturesToCheck { get; }
Property Value
| Type | Description |
|---|---|
| ISet<string> |
ElementKeys
Gets the element keys.
Declaration
public IEnumerable<Guid> ElementKeys { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Guid> |
ParentKeyForBranch
Gets the parent key of a branch.
Declaration
public Guid? ParentKeyForBranch { get; }
Property Value
| Type | Description |
|---|---|
| Guid? |
PermissionsToCheck
Gets the collection of permissions to authorize.
Declaration
public ISet<string> PermissionsToCheck { get; }
Property Value
| Type | Description |
|---|---|
| ISet<string> |
Remarks
All permissions have to be satisfied when evaluating.
Methods
View SourceBranch(ISet<string>, Guid)
Creates a ElementPermissionResource with the specified permissions and the branch from the specified parent key.
Declaration
public static ElementPermissionResource Branch(ISet<string> permissionsToCheck, Guid parentKeyForBranch)
Parameters
| Type | Name | Description |
|---|---|---|
| ISet<string> | permissionsToCheck | The permissions to check for. |
| Guid | parentKeyForBranch | The parent key of the branch. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
Branch(string, Guid)
Creates a ElementPermissionResource with the specified permission and the branch from the specified parent key.
Declaration
public static ElementPermissionResource Branch(string permissionToCheck, Guid parentKeyForBranch)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| Guid | parentKeyForBranch | The parent key of the branch. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
Branch(string, Guid, IEnumerable<string>)
Creates a ElementPermissionResource with the specified permission and the branch from the specified parent key.
Declaration
public static ElementPermissionResource Branch(string permissionToCheck, Guid parentKeyForBranch, IEnumerable<string> culturesToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| Guid | parentKeyForBranch | The parent key of the branch. |
| IEnumerable<string> | culturesToCheck | The required cultures |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
RecycleBin(ISet<string>)
Creates a ElementPermissionResource with the specified permissions and the recycle bin.
Declaration
public static ElementPermissionResource RecycleBin(ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| ISet<string> | permissionsToCheck | The permissions to check for. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
RecycleBin(string)
Creates a ElementPermissionResource with the specified permission and the recycle bin.
Declaration
public static ElementPermissionResource RecycleBin(string permissionToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
Root(ISet<string>)
Creates a ElementPermissionResource with the specified permissions and the root.
Declaration
public static ElementPermissionResource Root(ISet<string> permissionsToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| ISet<string> | permissionsToCheck | The permissions to check for. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
Root(ISet<string>, IEnumerable<string>)
Creates a ElementPermissionResource with the specified permissions and the root.
Declaration
public static ElementPermissionResource Root(ISet<string> permissionsToCheck, IEnumerable<string> cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| ISet<string> | permissionsToCheck | The permissions to check for. |
| IEnumerable<string> | cultures | The cultures to validate |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
Root(string)
Creates a ElementPermissionResource with the specified permission and the root.
Declaration
public static ElementPermissionResource Root(string permissionToCheck)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
Root(string, IEnumerable<string>)
Creates a ElementPermissionResource with the specified permission and the root.
Declaration
public static ElementPermissionResource Root(string permissionToCheck, IEnumerable<string> cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| IEnumerable<string> | cultures | The cultures to validate |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(ISet<string>, IEnumerable<Guid>)
Creates a ElementPermissionResource with the specified permissions and element keys.
Declaration
public static ElementPermissionResource WithKeys(ISet<string> permissionsToCheck, IEnumerable<Guid> elementKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| ISet<string> | permissionsToCheck | The permissions to check for. |
| IEnumerable<Guid> | elementKeys | The keys of the elements. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, IEnumerable<Guid>)
Creates a ElementPermissionResource with the specified permission and element keys.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, IEnumerable<Guid> elementKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| IEnumerable<Guid> | elementKeys | The keys of the elements. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, IEnumerable<Guid>, IEnumerable<string>)
Creates a ElementPermissionResource with the specified permission and element keys.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, IEnumerable<Guid> elementKeys, IEnumerable<string> cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| IEnumerable<Guid> | elementKeys | The keys of the elements. |
| IEnumerable<string> | cultures | The required culture access |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, IEnumerable<Guid?>)
Creates a ElementPermissionResource with the specified permission and element keys.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, IEnumerable<Guid?> elementKeys)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| IEnumerable<Guid?> | elementKeys | The keys of the elements or null if root. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, Guid)
Creates a ElementPermissionResource with the specified permission and element key.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, Guid elementKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| Guid | elementKey | The key of the element. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, Guid, IEnumerable<string>)
Creates a ElementPermissionResource with the specified permission and element key.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, Guid elementKey, IEnumerable<string> cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| Guid | elementKey | The key of the element. |
| IEnumerable<string> | cultures | The required culture access |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, Guid?)
Creates a ElementPermissionResource with the specified permission and element key or root.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, Guid? elementKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| Guid? | elementKey | The key of the element or null if root. |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |
WithKeys(string, Guid?, IEnumerable<string>)
Creates a ElementPermissionResource with the specified permission and element key or root.
Declaration
public static ElementPermissionResource WithKeys(string permissionToCheck, Guid? elementKey, IEnumerable<string> cultures)
Parameters
| Type | Name | Description |
|---|---|---|
| string | permissionToCheck | The permission to check for. |
| Guid? | elementKey | The key of the element or null if root. |
| IEnumerable<string> | cultures | The cultures to validate |
Returns
| Type | Description |
|---|---|
| ElementPermissionResource | An instance of ElementPermissionResource. |