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<IReadOnlyList<Char>>)
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, IReadOnlyList<char>? 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<IReadOnlyList<System.Char>> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(Int32, IUser, out IContent, Nullable<IReadOnlyList<Char>>)
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, IReadOnlyList<char>? 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<IReadOnlyList<System.Char>> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(IUmbracoEntity, IUser, IReadOnlyList<Char>)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IUmbracoEntity entity, IUser user, IReadOnlyList<char> permissionsToCheck)
Parameters
Type |
Name |
Description |
IUmbracoEntity |
entity |
|
IUser |
user |
|
IReadOnlyList<System.Char> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(IUmbracoEntity, IUser, Char)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IUmbracoEntity entity, IUser user, char permissionToCheck)
Parameters
Returns
View Source
CheckPermissions(IContent, IUser, IReadOnlyList<Char>)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IContent content, IUser user, IReadOnlyList<char> permissionsToCheck)
Parameters
Type |
Name |
Description |
IContent |
content |
|
IUser |
user |
|
IReadOnlyList<System.Char> |
permissionsToCheck |
|
Returns
View Source
CheckPermissions(IContent, IUser, Char)
Declaration
public ContentPermissions.ContentAccess CheckPermissions(IContent content, IUser user, char permissionToCheck)
Parameters
Type |
Name |
Description |
IContent |
content |
|
IUser |
user |
|
System.Char |
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 |
|