View Source
Class ContentPermissions
Checks user access to content
Assembly: Umbraco.Core.dll
Syntax
public class ContentPermissions
Constructors
View Source
ContentPermissions(IUserService, IContentService, IEntityService, AppCaches)
Declaration
public ContentPermissions(IUserService userService, IContentService contentService, IEntityService entityService, AppCaches appCaches)
Parameters
Methods
View Source
CheckPermissions(int, IUser, out IUmbracoEntity?, IReadOnlySet<string>?)
Checks if the user has access to the specified node and permissions set
Declaration
[Obsolete("Please use IContentPermissionService instead, scheduled for removal in V15.")]
public ContentPermissions.ContentAccess CheckPermissions(int nodeId, IUser user, out IUmbracoEntity? entity, IReadOnlySet<string>? permissionsToCheck = null)
Parameters
| Type |
Name |
Description |
| int |
nodeId |
|
| IUser |
user |
|
| IUmbracoEntity |
entity |
The IUmbracoEntity item resolved if one was found for the id
|
| IReadOnlySet<string> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(int, IUser?, out IContent?, IReadOnlySet<string>?)
Checks if the user has access to the specified node and permissions set
Declaration
[Obsolete("Please use IContentPermissionService instead, scheduled for removal in V15.")]
public ContentPermissions.ContentAccess CheckPermissions(int nodeId, IUser? user, out IContent? contentItem, IReadOnlySet<string>? permissionsToCheck = null)
Parameters
| Type |
Name |
Description |
| int |
nodeId |
|
| IUser |
user |
|
| IContent |
contentItem |
The IContent item resolved if one was found for the id
|
| IReadOnlySet<string> |
permissionsToCheck |
|
Returns
View Source
HasPathAccess(string?, int[]?, int)
Declaration
public static bool HasPathAccess(string? path, int[]? startNodeIds, int recycleBinId)
Parameters
| Type |
Name |
Description |
| string |
path |
|
| int[] |
startNodeIds |
|
| int |
recycleBinId |
|
Returns
View Source
IsInBranchOfStartNode(string, int[]?, string[]?, out bool)
Declaration
public static bool IsInBranchOfStartNode(string path, int[]? startNodeIds, string[]? startNodePaths, out bool hasPathAccess)
Parameters
| Type |
Name |
Description |
| string |
path |
|
| int[] |
startNodeIds |
|
| string[] |
startNodePaths |
|
| bool |
hasPathAccess |
|
Returns