class Privilege

Introduction

The class Privilege represents a generalized privilege that may be applied within a given scope. It has only three attributes: the GUID by which it is referenced, its name, and a text description. Objects of type Privilege can be use to develop enumerated lists of privileges for use by more specific privilege classes.

The privilege_name attribute is set at design time, and thereafter read-only. The description may be modified by method modify_description().

Constructor:

Privilege Privilege ( string privilege_name, text description)

Returns a privilege object with its name and description set to the arguments provided. The GUID for the object will not be set until the object is saved.

Methods

void save()
Privilege get_by_privilege_id (integer privilege_id)
integer get_privilege_id()
string get_privilege_name()
text get_description()
void modify_description(text new_description)
void save()

Saves the current Privilege object. If the object has been newly created, save() assigns an ID and creates a new record. Otherwise, save() updates the current record.

Privilege get_by_privilege_id (integer privilege_id)

Returns an existing Privilege object referenced by the privilege_id argument.

integer get_privilege_id()

Returns the unique ID of the current Privilege object.

string get_privilege_name()

Returns the name of the current Privilege object.

text get_description()

Returns the description of the current Privilege object.

void modify_description (text new_description)

Changes the description for the current privilege object to the text provided by the new_description argument.

See Also:

class OtherClass