| |||||||||||||||||
Programmer's Guide:
|
Enum |
Description |
erMemFlagNone |
Returns groups and users, doesn't expand groups |
erMemFlagExpandGroups |
Expands groups to show their membership |
erMemFlagGroupsOnly |
Returns only groups |
erMemFlagUsersOnly |
Returns only individual Users |
The following code snippet prints out the first names of all the Users in a Facility's member list.
Private Sub Print()
Dim App as new ERUApplication
dim uc as ERUUserContext
Dim Facility As IERUFacility
Dim Room As IERURoom
Dim Member As IERUMember
Dim Coll As IERUCollection
Set UC=App.LoginUser("asteele")
Set Facility = App.GetFacilityByName("fac6")
Set Coll = Facility.MemberManager.GetMembers(erMemFlagUsersOnly)
Dim m as member
For each m in Coll
Debug.Print m.FirstName 'Note in V7 .User interfaces
accessor not needed.
Next i
End Sub
Groups provide a way to collect members into a logical set, and to refer to them indirectly. The most common use of Groups is for defining eRoom membership, so that new team members can be admitted to all the Rooms they need to participate in without each eRoom's coordinator having to add them, individually, to that Room's participant list.
The simplest Group, "All", is created automatically, and includes all the members of a community's member list. As people are added to and deleted from the community's member list, they are automatically added to and removed from the member list for any Room that uses the All Group. Use the Flags property to determine if a Group returned from an API call is the All Group.
Adding and removing
group members
The AddMember method adds a member to
a Group. The RemoveMember method
removes a member from a Group. The member can be an individual User or
another Group. Remember that the member you add to a Group must already
exist in the community's member list.
Accessing members in
a group
The IERUGroup interface contains two methods that let you learn about and
access a Group's members.
Method |
Description |
Determines whether a User or Group is a member of a specified Group. | |
Returns an IERUCollection interface pointer to the members of a Group. |
A Member Set is a collection of eRoom Users and/or Groups. Member sets can be used for better performance when performing the same operations on many members. For example, if you want to add multiple members to a group, rather than make multiple AddMember calls, you can make a single call to AddMembers after adding the members to a member set.
The following code sample makes all of the members of Room1 members of Room2.
Dim Room1 as IERURoom
Dim Room2 as IERURoom
Dim User as IERUUser
Dim Group as IERUGroup
Dim MemberList as IERUCollection
Dim MemberSet as New ERUMemberSet
Set Room1 = Facility.GetRoomByName("room1")
Set Room2 = Facility.GetRoomByName("room2")
Set MemberList = Room1.GetMembers()
For each Member in MemberList
MemberSet.AddMember(Member)
Next
Room2.AddMembers(MemberSet, erRoleParticipant)
Users, once created, can later be deleted or deactivated. Deleting a user removes the user from the community's member list, although the user's name may still appear in some parts of the eRoom user interface. For example, the user still appears as the creator of an object, or in access control lists. Users who have been deleted cannot be undeleted. You can create another user with the same account information, but it will not be the same User object as the original, deleted user. The new user will, for example, have a different ID. To delete a User (or Group), call the Delete method in the IERUMember interface. You can still access deleted Users and Groups through SAAPI, if they are referenced by other objects, for example, as an item's creator. You can tell if a User or Group has been deleted by getting the IsDeleted property in the IERUMember interface.
Deactivating a User is an alternative to deleting that allows you to reactivate the user later. Deactivated Users do not consume licenses, so deactivating can prove convenient if you have a large user community that comes and goes over time - you can deactivate some users and add or reactivate others as necessary to stay at or below the number of users allowed by your license. Getting the IsDeactivated property in IERUMember indicates whether a User is deactivated, and setting the property deactivates or reactivates the User.
Note that you can't deactivate and reactivate Groups.
A custom role is a unique title for one of the three standard, built-in eRoom roles (coordinator, participant, observer). Custom roles give coordinators a way to assign members (individuals and groups) to meaningful, functional roles and to grant all members having the same role the same level of access in an eRoom. In addition, you can use custom roles everywhere you can use members or groups in an eRoom: Access control settings, routing permissions, database member list and approval fields, and so on.
Unlike groups, which are community-wide, custom roles are specific to a particular room.IERURoom contains a CreateCustomRolemethod and a CustomRolesproperty that let you work with custom roles. Use the CreateCustomRole method to create custom roles and the CustomRoles property to get an IERUCollection interface pointer to the collection of custom roles associated with a particular eRoom.
Custom roles are especially useful when you create template eRooms because you can assign specific functions to particular roles (such as Project Manager, or Editors) ahead of time. You can then use the CreateRoom method to create eRooms based on your template and use AddMember and AddMembers to fill those custom roles with the appropriate members or member sets. Members with custom roles have the access level accorded that role. As always in an eRoom, the highest level of access a member has whether through their individual or group status, takes precedence.
IERUCustomRole contains methods that let you add and remove members and groups to custom roles and properties that let you get a variety of information about custom roles, including name, description, access level, and the eRoom to which the role belongs.