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