View Source
Class ContentPermissions
Checks user access to content
Inheritance
System.Object
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(Int32, IUser, out IUmbracoEntity, Nullable<IReadOnlySet<String>>)
Checks if the user has access to the specified node and permissions set
Declaration
public ContentPermissions.ContentAccess CheckPermissions(int nodeId, IUser user, out IUmbracoEntity entity, IReadOnlySet<string>? permissionsToCheck = null)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
IUser |
user |
|
IUmbracoEntity |
entity |
The IUmbracoEntity item resolved if one was found for the id
|
System.Nullable<IReadOnlySet<System.String>> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(Int32, IUser, out IContent, Nullable<IReadOnlySet<String>>)
Checks if the user has access to the specified node and permissions set
Declaration
public ContentPermissions.ContentAccess CheckPermissions(int nodeId, IUser user, out IContent contentItem, IReadOnlySet<string>? permissionsToCheck = null)
Parameters
Type |
Name |
Description |
System.Int32 |
nodeId |
|
IUser |
user |
|
IContent |
contentItem |
The IContent item resolved if one was found for the id
|
System.Nullable<IReadOnlySet<System.String>> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(IUmbracoEntity, IUser, IReadOnlySet<String>)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IUmbracoEntity entity, IUser user, IReadOnlySet<string> permissionsToCheck)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
entity |
|
IUser |
user |
|
IReadOnlySet<System.String> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(IUmbracoEntity, IUser, String)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IUmbracoEntity entity, IUser user, string permissionToCheck)
Parameters
Returns
View Source
CheckPermissions(IContent, IUser, IReadOnlySet<String>)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IContent content, IUser user, IReadOnlySet<string> permissionsToCheck)
Parameters
Type |
Name |
Description |
IContent |
content |
|
IUser |
user |
|
IReadOnlySet<System.String> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(IContent, IUser, String)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IContent content, IUser user, string permissionToCheck)
Parameters
Type |
Name |
Description |
IContent |
content |
|
IUser |
user |
|
System.String |
permissionToCheck |
|
Returns
View Source
HasPathAccess(String, Int32[], Int32)
Declaration
public static bool HasPathAccess(string path, int[] startNodeIds, int recycleBinId)
Parameters
Type |
Name |
Description |
System.String |
path |
|
System.Int32[] |
startNodeIds |
|
System.Int32 |
recycleBinId |
|
Returns
Type |
Description |
System.Boolean |
|
View Source
IsInBranchOfStartNode(String, Int32[], String[], out Boolean)
Declaration
public static bool IsInBranchOfStartNode(string path, int[] startNodeIds, string[] startNodePaths, out bool hasPathAccess)
Parameters
Type |
Name |
Description |
System.String |
path |
|
System.Int32[] |
startNodeIds |
|
System.String[] |
startNodePaths |
|
System.Boolean |
hasPathAccess |
|
Returns
Type |
Description |
System.Boolean |
|