PtClassRight is a class which is used to assign rights to a class when user authorization is enabled. To assign rights, simply create a PtClassRight, specifying the user or group and the class to which these rights should be given, then store the PtClassRight in the database. To store a PtClassRight, you must have POETADM rights. See "User Authorization" for details.
The PtClassRight class is pre-registered in every POET dictionary. Here is the equivalent class declaration for PtClassRight:
PtClassRight | _persistent class PtClassRight |
Files to include | Class declaration | Base class |
poet.hxx ptuser.hxx | ptrights.hxx | PtRight |
constructor | PtClassRight(PtUser* , PtClassId& , unsigned short readable, unsigned short writable, unsigned short deletable); |
destructor | virtual ~PtClassRight(); |
Match | virtual int Match(PtClassId& ); |
- PtClassRight::PtClassRight(PtUser* pUser, PtClassId& classId, unsigned short readable, unsigned short writable, unsigned short deletable)
Constructor. Creating and storing a PtClassRight assigns rights to the class.
PtUser* pUser | The user or group who should be granted these rights |
PtClassId& classId | The class to which rights should be granted |
unsigned short readable | Read rights to be granted |
unsigned short writable | Write rights to be granted |
unsigned short deletable | Delete rights to be granted |
You can get a PtClassId for a class by browsing the class dictionary, or by calling PtObject:: GetClassId() for an object of the given class.
Rights are not granted until the PtRight is actually stored.
- virtual PtClassRight::~PtClassRight()
- virtual int PtClassRight::Match(PtClassId& classId)
Returns a non-zero value if the class for which the PtClassRight is defined is the same class as classId or is a base class for classId.
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.