Class UserGroupService
- Namespace
- Dynamicweb.Security.UserManagement
- Assembly
- Dynamicweb.Core.dll
public class UserGroupService : ICacheStorage<int, UserGroup>, ICacheStorage<int>, ICacheStorage
- Inheritance
-
UserGroupService
- Implements
- Inherited Members
Properties
Info
Information about the object cache
public CacheInformation Info { get; }
Property Value
Methods
AddUserRelations(UserGroup, IEnumerable<User>)
Adds user relations to a user group.
public virtual void AddUserRelations(UserGroup group, IEnumerable<User> users)
Parameters
groupUserGroupUser group.
usersIEnumerable<User>Users to add.
ClearCache()
Resets all keys to the default value for objects stored in the object cache
public virtual void ClearCache()
Delete(UserGroup)
Deletes a user group.
public virtual void Delete(UserGroup group)
Parameters
groupUserGroupUser group to delete.
GetGroupById(int)
Gets a user group by id.
public virtual UserGroup? GetGroupById(int id)
Parameters
idintIdentifier of a user group.
Returns
GetGroupIdsByUserId(int)
Gets user group ids associated with a given user id.
public virtual IEnumerable<int> GetGroupIdsByUserId(int userId)
Parameters
userIdintIdentifier of a user.
Returns
GetGroupPathForUser(int)
Gets a group path for the passed user id. If the user is direct member of more than one group, it is the first group that is used for the path
public virtual string GetGroupPathForUser(int userId)
Parameters
userIdintId of a user
Returns
GetGroups()
Gets all user groups.
public virtual IEnumerable<UserGroup> GetGroups()
Returns
GetGroupsById(IEnumerable<int>)
Gets user groups by id.
public virtual IEnumerable<UserGroup> GetGroupsById(IEnumerable<int> ids)
Parameters
idsIEnumerable<int>Identifiers of user groups.
Returns
GetGroupsByIdWithSubgroups(IEnumerable<int>)
Gets user groups, including descendent groups, by ids.
public virtual IEnumerable<UserGroup> GetGroupsByIdWithSubgroups(IEnumerable<int> ids)
Parameters
idsIEnumerable<int>Identifiers of user groups.
Returns
GetGroupsByParentGroupId(int)
Gets user groups by parent group id.
public virtual IEnumerable<UserGroup> GetGroupsByParentGroupId(int parentGroupId)
Parameters
parentGroupIdintIdentifier of a parent user group.
Returns
GetGroupsByUserId(int)
Gets user groups associated with a given user id.
public virtual IEnumerable<UserGroup> GetGroupsByUserId(int userId)
Parameters
userIdintIdentifier of a user.
Returns
RemoveSmartSearchRelations(Guid)
public virtual void RemoveSmartSearchRelations(Guid smartSearchId)
Parameters
smartSearchIdGuid
RemoveUserRelations(UserGroup)
Removes all user relations from a user group.
public virtual void RemoveUserRelations(UserGroup group)
Parameters
groupUserGroupUser group.
RemoveUserRelations(UserGroup, IEnumerable<User>)
Removes user relations from a group.
public virtual void RemoveUserRelations(UserGroup group, IEnumerable<User> users)
Parameters
groupUserGroupUser group.
usersIEnumerable<User>Users to remove.
Save(UserGroup)
Saves a user group.
public virtual void Save(UserGroup group)
Parameters
groupUserGroupUser group to save.
SetCacheType<TObjectCache>()
Changes the storage container
public void SetCacheType<TObjectCache>() where TObjectCache : ServiceCache<int, UserGroup>
Type Parameters
TObjectCache
SortUserRelations(UserGroup, IEnumerable<User>)
Sorts user relations within a specified user group according to an ordered list of users.
public virtual void SortUserRelations(UserGroup group, IEnumerable<User> orderedUsers)
Parameters
groupUserGroupThe user group whose relations will be sorted.
orderedUsersIEnumerable<User>An ordered collection of users defining the new relation order.