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. |
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. |
public addItemChild ( string $itemName, string $childName ) | ||
$itemName | string | the item name. |
$childName | string | the child item name. |
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. |
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. |
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. |
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 |
public updateItemWeight ( array $result ) | ||
$result | array | the result returned from jui-sortable. |
public $assignmentTable |
public $itemChildTable |