PHP Class RDbAuthManager, gxc-cms

Since: 0.9.7
Author: Christoffer Niska ([email protected])
Inheritance: extends CDbAuthManager
Show file Open project: nganhtuan63/gxc-cms

Public Properties

Property Type Description
$assignmentTable the name of the table storing authorization item assignments. Defaults to 'AuthAssignment'.
$itemChildTable the name of the table storing authorization item hierarchy. Defaults to 'AuthItemChild'.
$itemTable
$rightsTable the name of the rights table.

Public Methods

Method Description
addItemChild ( string $itemName, string $childName ) Adds an item as a child of another item.
assign ( string $itemName, mixed $userId, string $bizRule = null, mixed $data = null ) : CAuthAssignment Assigns an authorization item to a user making sure that the user doesn't already have this assignment.
getAssignmentsByItemName ( $name )
getAuthItem ( string $name, boolean $allowCaching = true ) : CAuthItem Returns the authorization item with the specified name.
getAuthItems ( integer $type = null, mixed $userId = null, boolean $sort = true ) : array Returns the authorization items of the specific type and user.
getAuthItemsByNames ( array $names, boolean $nested = false ) : array Returns the specified authorization items.
getItemChildren ( mixed $names, boolean $allowCaching = true ) : array Returns the children of the specified item.
updateItemWeight ( array $result ) Updates the authorization items weight.

Method Details

addItemChild() public method

Overloads the parent method to make sure that we do not add already existing children.
public addItemChild ( string $itemName, string $childName )
$itemName string the item name.
$childName string the child item name.

assign() public method

Overloads the parent method to make sure that we do not assign already assigned items.
public assign ( string $itemName, mixed $userId, string $bizRule = null, mixed $data = null ) : CAuthAssignment
$itemName string the item name.
$userId mixed the user ID (see {@link IWebUser::getId})
$bizRule string the business rule to be executed when {@link checkAccess} is called for this particular authorization item.
$data mixed additional data associated with this assignment.
return CAuthAssignment the authorization assignment information.

getAssignmentsByItemName() public method

public getAssignmentsByItemName ( $name )

getAuthItem() public method

Overloads the parent method to allow for runtime caching.
public getAuthItem ( string $name, boolean $allowCaching = true ) : CAuthItem
$name string the name of the item.
$allowCaching boolean whether to accept cached data.
return CAuthItem the authorization item. Null if the item cannot be found.

getAuthItems() public method

Overloads the parent method to allow for sorting.
public getAuthItems ( integer $type = null, mixed $userId = null, boolean $sort = true ) : array
$type integer the item type (0: operation, 1: task, 2: role). Defaults to null, meaning returning all items regardless of their type.
$userId mixed the user ID. Defaults to null, meaning returning all items even if they are not assigned to a user.
$sort boolean whether to sort the items according to their weights.
return array the authorization items of the specific type.

getAuthItemsByNames() public method

Returns the specified authorization items.
public getAuthItemsByNames ( array $names, boolean $nested = false ) : array
$names array the names of the authorization items to get.
$nested boolean whether to nest the items by type.
return array the authorization items.

getItemChildren() public method

Overloads the parent method to allow for caching.
public getItemChildren ( mixed $names, boolean $allowCaching = true ) : array
$names mixed the parent item name. This can be either a string or an array. The latter represents a list of item names (available since version 1.0.5).
$allowCaching boolean whether to accept cached data.
return array all child items of the parent

updateItemWeight() public method

Updates the authorization items weight.
public updateItemWeight ( array $result )
$result array the result returned from jui-sortable.

Property Details

$assignmentTable public property

the name of the table storing authorization item assignments. Defaults to 'AuthAssignment'.
public $assignmentTable

$itemChildTable public property

the name of the table storing authorization item hierarchy. Defaults to 'AuthItemChild'.
public $itemChildTable

$itemTable public property

public $itemTable

$rightsTable public property

the name of the rights table.
public $rightsTable