A right to do or access something.

A right is accessed from the system by its $identname, not from its numeric ID.

package dstruct_auth

 Methods

Class constructor.

__construct(mixed $row) 

Parameters

$row

mixed

Database row or false.

Add an Implied Right inherited when user has this right.

addImpliedRight(\Right $right) 

Parameters

$right

\Right

Return the ID of this object.

getID() : integer

Returns

integer

Identifier used when accessing this right from script.

getIdentName() : string

This would typically be something readable such as 'access_reports' or 'edit_invoices'.

Returns

string

Any rights implied by ownership of this right.

getImpliedRights() : object

Returns

objectA collection object

Return the Title of this right.

getTitle(boolean $raw) : string

Typically something which would be displayed to users such as 'Access Reports' or 'Edit Invoices'.

Parameters

$raw

boolean

Return raw or html encoded

Returns

string

Load object by its ID.

loadByID(integer $id, array $row) : false | object
Static

Parameters

$id

integer

$row

array

Data for creating an instance of this class

Returns

falseobjectFalse if object not found

Returns array of permissions granted and implied by this right.

permissions() : array

Returns

array

Remove an Implied Right granted by ownership of this right.

removeImpliedRight(\Right $right) 

Parameters

$right

\Right

Save in the database.

save() 

Set the IdentName by which this right is identified in script.

setIdentName(string $name) 

Should be all lower-case and only contain alpha-numerics and underscore

Parameters

$name

string

Set the easily identifiable name for this right.

setTitle(string $title) 

Parameters

$title

string

Lazy loader for Object Collection.

loadImpliedRights() 

 Properties

 

$id : integer
 

$identname : string
 

$impliedrights : null | object
 

$title : string