Class UserServiceExtensions
Inheritance
System.Object
Namespace: Umbraco.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public static class UserServiceExtensions
Methods
View SourceGetPermissions(IUserService, IUser, String)
Declaration
public static EntityPermission GetPermissions(this IUserService userService, IUser user, string path)
Parameters
Type | Name | Description |
---|---|---|
IUserService | userService | |
IUser | user | |
System.String | path |
Returns
Type | Description |
---|---|
EntityPermission |
GetPermissions(IUserService, IUserGroup, Boolean, Int32[])
Get explicitly assigned permissions for a group and optional node Ids
Declaration
public static EntityPermissionCollection GetPermissions(this IUserService service, IUserGroup group, bool fallbackToDefaultPermissions, params int[] nodeIds)
Parameters
Type | Name | Description |
---|---|---|
IUserService | service | |
IUserGroup | group | |
System.Boolean | fallbackToDefaultPermissions | Flag indicating if we want to include the default group permissions for each result if there are not explicit permissions set |
System.Int32[] | nodeIds | Specifying nothing will return all permissions for all nodes |
Returns
Type | Description |
---|---|
EntityPermissionCollection | An enumerable list of EntityPermission |
GetPermissionsForPath(IUserService, IUserGroup, String, Boolean)
Gets the permissions for the provided group and path
Declaration
public static EntityPermissionSet GetPermissionsForPath(this IUserService service, IUserGroup group, string path, bool fallbackToDefaultPermissions = false)
Parameters
Type | Name | Description |
---|---|---|
IUserService | service | |
IUserGroup | group | |
System.String | path | Path to check permissions for |
System.Boolean | fallbackToDefaultPermissions | Flag indicating if we want to include the default group permissions for each result if there are not explicit permissions set |
Returns
Type | Description |
---|---|
EntityPermissionSet |
RemoveUserGroupPermissions(IUserService, Int32)
Remove all permissions for this user group for all nodes
Declaration
public static void RemoveUserGroupPermissions(this IUserService userService, int groupId)
Parameters
Type | Name | Description |
---|---|---|
IUserService | userService | |
System.Int32 | groupId |
RemoveUserGroupPermissions(IUserService, Int32, Int32[])
Remove all permissions for this user group for all nodes specified
Declaration
public static void RemoveUserGroupPermissions(this IUserService userService, int groupId, params int[] entityIds)
Parameters
Type | Name | Description |
---|---|---|
IUserService | userService | |
System.Int32 | groupId | |
System.Int32[] | entityIds |