Class ContentPermissions
Checks user access to content
Inheritance
object
Namespace: Umbraco.Cms.Core.Security
Assembly: Umbraco.Core.dll
Syntax
public class ContentPermissions
Constructors
View SourceContentPermissions(IUserService, IContentService, IEntityService, AppCaches)
Initializes a new instance of the ContentPermissions class.
Declaration
public ContentPermissions(IUserService userService, IContentService contentService, IEntityService entityService, AppCaches appCaches)
Parameters
| Type | Name | Description |
|---|---|---|
| IUserService | userService | The user service. |
| IContentService | contentService | The content service. |
| IEntityService | entityService | The entity service. |
| AppCaches | appCaches | The application caches. |
Methods
View SourceHasPathAccess(string?, int[]?, int)
Checks if the user has path access to a content item.
Declaration
public static bool HasPathAccess(string? path, int[]? startNodeIds, int recycleBinId)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path of the content item. |
| int[] | startNodeIds | The user's start node IDs. |
| int | recycleBinId | The recycle bin ID. |
Returns
| Type | Description |
|---|---|
| bool |
|
IsInBranchOfStartNode(string, int[]?, string[]?, out bool)
Determines if a path is within the branch of the user's start node.
Declaration
public static bool IsInBranchOfStartNode(string path, int[]? startNodeIds, string[]? startNodePaths, out bool hasPathAccess)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | The path to check. |
| int[] | startNodeIds | The user's start node IDs. |
| string[] | startNodePaths | The user's start node paths. |
| bool | hasPathAccess | Outputs whether the user has direct path access. |
Returns
| Type | Description |
|---|---|
| bool |
|