View Source
Class UserGroupRepository
Represents the UserGroupRepository for doing CRUD operations for IUserGroup
Inheritance
System.Object
Assembly: Umbraco.Infrastructure.dll
Syntax
public class UserGroupRepository : EntityRepositoryBase<int, IUserGroup>, IUserGroupRepository, IReadWriteQueryRepository<int, IUserGroup>, IReadRepository<int, IUserGroup>, IWriteRepository<IUserGroup>, IQueryRepository<IUserGroup>, IRepository
Constructors
View Source
UserGroupRepository(IScopeAccessor, AppCaches, ILogger<UserGroupRepository>, ILoggerFactory, IShortStringHelper)
Declaration
public UserGroupRepository(IScopeAccessor scopeAccessor, AppCaches appCaches, ILogger<UserGroupRepository> logger, ILoggerFactory loggerFactory, IShortStringHelper shortStringHelper)
Parameters
Methods
View Source
AddOrUpdateGroupWithUsers(IUserGroup, Int32[])
Declaration
public void AddOrUpdateGroupWithUsers(IUserGroup userGroup, int[] userIds)
Parameters
Type |
Name |
Description |
IUserGroup |
userGroup |
|
System.Int32[] |
userIds |
|
View Source
AssignGroupPermission(Int32, Char, Int32[])
Assigns the same permission set for a single group to any number of entities
Declaration
public void AssignGroupPermission(int groupId, char permission, params int[] entityIds)
Parameters
Type |
Name |
Description |
System.Int32 |
groupId |
Id of group
|
System.Char |
permission |
Permissions as enumerable list of System.Char
|
System.Int32[] |
entityIds |
Specify the nodes to replace permissions for
|
View Source
Get(String)
Declaration
public IUserGroup Get(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
Returns
View Source
GetBaseQuery(Boolean)
Declaration
protected override Sql<ISqlContext> GetBaseQuery(bool isCount)
Parameters
Type |
Name |
Description |
System.Boolean |
isCount |
|
Returns
View Source
GetBaseQuery(QueryType)
Declaration
protected Sql<ISqlContext> GetBaseQuery(QueryType type)
Parameters
Returns
View Source
GetBaseWhereClause()
Declaration
protected override string GetBaseWhereClause()
Returns
Type |
Description |
System.String |
|
View Source
GetByAliasCacheKey(String)
Declaration
public static string GetByAliasCacheKey(string alias)
Parameters
Type |
Name |
Description |
System.String |
alias |
|
Returns
Type |
Description |
System.String |
|
View Source
GetDeleteClauses()
Declaration
protected override IEnumerable<string> GetDeleteClauses()
Returns
Type |
Description |
IEnumerable<System.String> |
|
View Source
GetGroupsAssignedToSection(String)
Declaration
public IEnumerable<IUserGroup> GetGroupsAssignedToSection(string sectionAlias)
Parameters
Type |
Name |
Description |
System.String |
sectionAlias |
|
Returns
View Source
GetPermissions(Int32[], Int32[])
Gets explicitly defined permissions for the group for specified entities
Declaration
public EntityPermissionCollection GetPermissions(int[] groupIds, params int[] entityIds)
Parameters
Type |
Name |
Description |
System.Int32[] |
groupIds |
|
System.Int32[] |
entityIds |
Array of entity Ids, if empty will return permissions for the group for all entities
|
Returns
View Source
GetPermissions(IReadOnlyUserGroup[], Boolean, Int32[])
Gets explicit and default permissions (if requested) permissions for the group for specified entities
Declaration
public EntityPermissionCollection GetPermissions(IReadOnlyUserGroup[] groups, bool fallbackToDefaultPermissions, params int[] nodeIds)
Parameters
Type |
Name |
Description |
IReadOnlyUserGroup[] |
groups |
|
System.Boolean |
fallbackToDefaultPermissions |
If true will include the group's default permissions if no permissions are
explicitly assigned
|
System.Int32[] |
nodeIds |
Array of entity Ids, if empty will return permissions for the group for all entities
|
Returns
View Source
Declaration
protected override IUserGroup PerformGet(int id)
Parameters
Type |
Name |
Description |
System.Int32 |
id |
|
Returns
View Source
Declaration
protected override IEnumerable<IUserGroup> PerformGetAll(params int[] ids)
Parameters
Type |
Name |
Description |
System.Int32[] |
ids |
|
Returns
View Source
Declaration
protected override IEnumerable<IUserGroup> PerformGetByQuery(IQuery<IUserGroup> query)
Parameters
Returns
View Source
PersistNewItem(IUserGroup)
Declaration
protected override void PersistNewItem(IUserGroup entity)
Parameters
View Source
PersistUpdatedItem(IUserGroup)
Declaration
protected override void PersistUpdatedItem(IUserGroup entity)
Parameters
View Source
ReplaceGroupPermissions(Int32, Nullable<IEnumerable<Char>>, Int32[])
Replaces the same permission set for a single group to any number of entities
Declaration
public void ReplaceGroupPermissions(int groupId, IEnumerable<char>? permissions, params int[] entityIds)
Parameters
Type |
Name |
Description |
System.Int32 |
groupId |
Id of group
|
System.Nullable<IEnumerable<System.Char>> |
permissions |
Permissions as enumerable list of System.Char If nothing is specified all permissions
are removed.
|
System.Int32[] |
entityIds |
Specify the nodes to replace permissions for.
|