Main Table of Contents


Table of Contents

class PtGroup
PtGroup: class summary
PtGroup::PtGroup()
PtGroup::~PtGroup()
PtGroup::AddMember()
PtGroup::IsMember()
PtGroup::DeleteMember()
PtGroup::Members()

class PtGroup


Intro
PtGroup: class summary
PtGroup::PtGroup()
PtGroup::~PtGroup()
PtGroup::AddMember()
PtGroup::IsMember()
PtGroup::DeleteMember()
PtGroup::Members()

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;


PtGroup: class summary


Intro

Files to include Class declaration Base class
poet.hxx ptuser.hxx ptuser.hxx PtUser

Member functions:

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()


Intro

Declaration:

PtGroup::PtGroup(PtString& loginname, short userid, PtString& realname)

Description:

Constructor for a group.

Parameters:

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.

Example:

PtGroup Heroes( PtString("Heroes"), 0,
PtString("Valiant and courageous heroes"));

Discussion:

No rights are assigned until you assign users to the group, store the group in the database, and store the users.


PtGroup::~PtGroup()


Intro

Declaration:

virtual PtGroup::~PtGroup()

Description:

Destructor.


PtGroup::AddMember()


Intro

Declaration:

int PtGroup::AddMember(PtUser* )

Description:

Please do not use this function. Instead, use PtUser:: AddToGroup() to add a user to a group.


PtGroup::IsMember()


Intro

Declaration:

int PtGroup::IsMember(PtUser* )

Description:

Please do not use this function. Instead, use PtUser:: IsInGroup() to see if a user is a member of a group.


PtGroup::DeleteMember()


Intro

Declaration:

int PtGroup::DeleteMember(PtUser* )

Description:

Please do not use this function. Instead, use PtUser:: RemoveFromGroup() to remove a user from a group.


PtGroup::Members()


Intro

Declaration:

PtUserSet* PtGroup::Members()

Description:

Returns a PtUserSet containing the members of the group. A PtUserSet is equivalent to a set declared like this:

typedef cset<ondemand<PtUser>> PtUserSet;

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.