PtGroup is used to assign group rights for user authorization. A PtGroup has a set of members, and the members of a group are granted all access rights owned by the group.
The PtGroup class is pre-registered in every POET dictionary, and classes for ondemands, sets, allsets, and queries for PtGroup have also been pre-registered. The following table lists the pre-registered classes, and shows the equivalent class declaration for each class:
PtGroup | persistent class PtGroup |
PtGroupAllSet | AllSet generated from above declaration |
PtGroupQuery | Query class generated from above declaration |
PtGroupOnDemand | typedef ondemand<PtGroup> PtGroupOnDemand |
PtGroupOnDemandCSet | typedef cset<ondemand<PtGroup>> PtGroupOnDemandCSet; |
Files to include | Class declaration | Base class |
poet.hxx ptuser.hxx | ptuser.hxx | PtUser |
constructor | PtGroup(PtString& loginname, short userid, PtString& realname); |
destructor | virtual ~PtGroup(); |
AddMember | int AddMember(PtUser* ); |
IsMember | int IsMember(PtUser* ); |
DeleteMember | int DeleteMember(PtUser* ); |
Members | PtUserSet* Members(); |
- PtGroup::PtGroup(PtString& loginname, short userid, PtString& realname)
PtString& loginname | A short name used to identify the group. |
short userid | User ID for the group. If this is 0, POET will generate a unique user ID. |
- PtGroup Heroes( PtString("Heroes"), 0,
- PtString("Valiant and courageous heroes"));
No rights are assigned until you assign users to the group, store the group in the database, and store the users.
- virtual PtGroup::~PtGroup()
- int PtGroup::AddMember(PtUser* )
Please do not use this function. Instead, use PtUser:: AddToGroup() to add a user to a group.
- int PtGroup::IsMember(PtUser* )
Please do not use this function. Instead, use PtUser:: IsInGroup() to see if a user is a member of a group.
- int PtGroup::DeleteMember(PtUser* )
Please do not use this function. Instead, use PtUser:: RemoveFromGroup() to remove a user from a group.
- PtUserSet* PtGroup::Members()
Returns a PtUserSet containing the members of the group. A PtUserSet is equivalent to a set declared like this:
Use the set only to examine the members, do not add or delete users from the set. Instead, use PtUser:: AddToGroup() and PtUser:: RemoveFromGroup() to maintain the list of members.
Copyright (c) 1996 POET Software, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without the express permission of POET Software, Inc. is prohibited.