Show / Hide Table of Contents

Class UserGroupCache

Cache holding information about the users (e.g. associates) user groups

Inheritance
Object
CacheBaseV2
UserGroupCache
Implements
IFlushableV2
IDisposable
Inherited Members
CacheBaseV2.Dispose()
CacheBaseV2.Flush()
CacheBaseV2.BeginDisableAutoUpdate()
CacheBaseV2.Load()
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.Security
Assembly: SoDataBase.dll
Syntax
[CacheV2("Database")]
public sealed class UserGroupCache : CacheBaseV2, IFlushableV2, IDisposable

Methods

GetAllGroupsForAssociate()

Get all groups (e.g. primary and secondary) that the logged in user belongs to.

Declaration
public IEnumerable<int> GetAllGroupsForAssociate()
Returns
Type Description
IEnumerable<Int32>

All groups that an associate belongs to.

GetAllGroupsForAssociate(Int32)

Get all groups (e.g. primary and secondary) that the associate represented by the associateId belongs to.

Declaration
public IEnumerable<int> GetAllGroupsForAssociate(int associateId)
Parameters
Type Name Description
Int32 associateId

Associate id for the associate to check for.

Returns
Type Description
IEnumerable<Int32>

All groups that an associate belongs to.

GetAssociatesInGroup(Int32)

Get the id's of all associates in a group (primary or secondary group does not matter)

Declaration
public IEnumerable<int> GetAssociatesInGroup(int userGroupId)
Parameters
Type Name Description
Int32 userGroupId

Group id

Returns
Type Description
IEnumerable<Int32>

Array of associates, may be empty but never null

GetCount()

Get the number of user groups in the system

Declaration
public int GetCount()
Returns
Type Description
Int32

GetCurrent()

Obtain an instance of the cache

Declaration
public static UserGroupCache GetCurrent()
Returns
Type Description
UserGroupCache

GetDefaultUserGroup()

Get the default user group for the logged in associate.

Declaration
public int GetDefaultUserGroup()
Returns
Type Description
Int32

Defualt usergroup for the associate. 0 means that there are no usergroups.

GetDefaultUserGroup(Int32)

Get the default user group for an associate.

Declaration
public int GetDefaultUserGroup(int associateId)
Parameters
Type Name Description
Int32 associateId

AssociateId for the associate to get the usergroup for.

Returns
Type Description
Int32

Defualt usergroup for the associate. 0 means that there are no usergroups.

GetGroupRelationToUser(Int32)

Get the group relation from the currently logged on user to another user.

Declaration
public UserGroupCache.GroupRelation GetGroupRelationToUser(int toAssociateId)
Parameters
Type Name Description
Int32 toAssociateId

The associate owning the item to check for.

Returns
Type Description
UserGroupCache.GroupRelation

Kind of relation to the group.

GetGroupRelationToUser(Int32, Int32)

Declaration
public UserGroupCache.GroupRelation GetGroupRelationToUser(int fromAssociateId, int toAssociateId)
Parameters
Type Name Description
Int32 fromAssociateId
Int32 toAssociateId
Returns
Type Description
UserGroupCache.GroupRelation

GetGroupRelationToUser(Int32, Int32, out Int32)

Get the group relation between two users.

Declaration
public UserGroupCache.GroupRelation GetGroupRelationToUser(int fromAssociateId, int toAssociateId, out int firstCommonGroup)
Parameters
Type Name Description
Int32 fromAssociateId

The current associate.

Int32 toAssociateId

The associate owning the item to check for.

Int32 firstCommonGroup
Returns
Type Description
UserGroupCache.GroupRelation

Kind of relation to the group.

GetSecondaryGroupsForAssociate()

Get secondary groups that the logged in user is member of.

Declaration
public IEnumerable<int> GetSecondaryGroupsForAssociate()
Returns
Type Description
IEnumerable<Int32>

List of secondary groups the logged in user is member of.

GetSecondaryGroupsForAssociate(Int32)

Get secondary groups that a given associate is member of.

Declaration
public IEnumerable<int> GetSecondaryGroupsForAssociate(int associateId)
Parameters
Type Name Description
Int32 associateId

Associate id for the user to get groups for.

Returns
Type Description
IEnumerable<Int32>

List of secondary groups the associate is member of.

GetUserGroup(Int32)

Get a UserGroupRecordData from it's primary key.

Declaration
public UserGroupRecordData GetUserGroup(int userGroupId)
Parameters
Type Name Description
Int32 userGroupId

UserGroupId (also known as GroupIdx)

Returns
Type Description
UserGroupRecordData

Instance of the record.

GetUserGroupIds()

Get all user group id's as an array

Declaration
public IEnumerable<int> GetUserGroupIds()
Returns
Type Description
IEnumerable<Int32>

Array, may be empty but never null

IsAssociateInGroup(Int32)

Check if the currently logged on associate is member of a group.

Declaration
public bool IsAssociateInGroup(int userGroupId)
Parameters
Type Name Description
Int32 userGroupId

Usergroup to check membership in.

Returns
Type Description
Boolean

True if the user is member of the UserGroup.

IsAssociateInGroup(Int32, Int32)

Check if an associate is member of a group.

Declaration
public bool IsAssociateInGroup(int associateId, int userGroupId)
Parameters
Type Name Description
Int32 associateId

Associate to check membership for.

Int32 userGroupId

Usergroup to check membership in.

Returns
Type Description
Boolean

True if the user is member of the UserGroup.

OnLoad()

Declaration
protected override void OnLoad()
Overrides
CacheBaseV2.OnLoad()

Implements

IFlushableV2
System.IDisposable

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top