HCE Project DC service web UI  0.2
Hierarchical Cluster Engine DC service web UI
 All Classes Namespaces Files Functions Variables Pages
Rights Class Reference

Static Public Member Functions

static assign ($itemName, $userId, $bizRule=null, $data=null)
static revoke ($itemName, $userId)
static getAssignedRoles ($userId=null, $sort=true)
static getBaseUrl ()
static getAuthItemOptions ()
static getAuthItemTypeName ($type)
static getAuthItemTypeNamePlural ($type)
static getAuthItemRoute ($type)
static getValidChildTypes ($type)
static getAuthItemSelectOptions ($type=null, $exclude=array())
static getParentAuthItemSelectOptions (CAuthItem $parent, $type=null, $exclude=array())
static getDataCsrf ()
static getCsrfParam ()
static powered ()
static module ()
static getAuthorizer ()
static t ($category, $message, $params=array(), $source=null, $language=null)

Public Attributes

const PERM_NONE = 0
const PERM_DIRECT = 1
const PERM_INHERITED = 2

Static Protected Member Functions

static generateAuthItemSelectOptions ($items, $type)

Static Private Member Functions

static findModule (CModule $module=null)

Static Private Attributes

static $_m
static $_a

Detailed Description

Rights helper class file.

Provides static functions for interaction with Rights from outside of the module.

Author
Christoffer Niska cnisk.nosp@m.a@li.nosp@m.ve.co.nosp@m.m
Since
0.9.1

Definition at line 12 of file Rights.php.

Member Function Documentation

static Rights::assign (   $itemName,
  $userId,
  $bizRule = null,
  $data = null 
)
static

Assigns an authorization item to a specific user.

Parameters
string$itemNamethe name of the item to assign.
integer$userIdthe user id of the user for which to assign the item.
string$bizRulebusiness rule associated with the item. This is a piece of PHP code that will be executed when checkAccess is called for the item.
mixed$dataadditional data associated with the item.
Returns
CAuthItem the authorization item

Definition at line 32 of file Rights.php.

Here is the call graph for this function:

static Rights::findModule ( CModule  $module = null)
staticprivate

Searches for the Rights module among all installed modules. The module will be found even if it's nested within another module.

Parameters
CModule$modulethe module to find the module in. Defaults to null, meaning that the application will be used.
Returns
the Rights module.

Definition at line 298 of file Rights.php.

Here is the caller graph for this function:

static Rights::generateAuthItemSelectOptions (   $items,
  $type 
)
staticprotected

Generates the authorization item select options.

Parameters
array$itemsthe authorization items.
mixed$typethe item type (0: operation, 1: task, 2: role).
Returns
array the select options.

Definition at line 216 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getAssignedRoles (   $userId = null,
  $sort = true 
)
static

Returns the roles assigned to a specific user. If no user id is provided the logged in user will be used.

Parameters
integer$userIdthe user id of the user for which roles to get.
boolean$sortwhether to sort the items by their weights.
Returns
array the roles.

Definition at line 63 of file Rights.php.

Here is the call graph for this function:

static Rights::getAuthItemOptions ( )
static

Returns the list of authorization item types.

Returns
array the list of types.

Definition at line 92 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getAuthItemRoute (   $type)
static

Returns the route to a specific authorization item list view.

Parameters
integer$typethe item type (0: operation, 1: task, 2: role).
Returns
array the route.

Definition at line 142 of file Rights.php.

Here is the call graph for this function:

static Rights::getAuthItemSelectOptions (   $type = null,
  $exclude = array() 
)
static

Returns the authorization item select options.

Parameters
mixed$typethe item type (0: operation, 1: task, 2: role). Defaults to null, meaning returning all items regardless of their type.
array$excludethe items to be excluded.
Returns
array the select options.

Definition at line 182 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getAuthItemTypeName (   $type)
static

Returns the name of a specific authorization item.

Parameters
integer$typethe item type (0: operation, 1: task, 2: role).
Returns
string the authorization item type name.

Definition at line 108 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getAuthItemTypeNamePlural (   $type)
static

Returns the name of a specific authorization item in plural.

Parameters
integer$typethe item type (0: operation, 1: task, 2: role).
Returns
string the authorization item type name.

Definition at line 125 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getAuthorizer ( )
static
Returns
RAuthorizer the authorizer component.

Definition at line 320 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getBaseUrl ( )
static

Returns the base url to Rights.

Returns
the url to Rights.

Definition at line 80 of file Rights.php.

Here is the call graph for this function:

static Rights::getCsrfParam ( )
static

Returns the cross-site request forgery parameter for Ajax-requests. Null is returned if csrf-validation is disabled.

Returns
string the csrf parameter.

Definition at line 254 of file Rights.php.

static Rights::getDataCsrf ( )
static

Returns the cross-site request forgery parameter to be placed in the data of Ajax-requests. An empty string is returned if csrf-validation is disabled.

Returns
string the csrf parameter.

Definition at line 243 of file Rights.php.

Here is the caller graph for this function:

static Rights::getParentAuthItemSelectOptions ( CAuthItem  $parent,
  $type = null,
  $exclude = array() 
)
static

Returns the valid authorization item select options for a model.

Parameters
mixed$parentthe item type (0: operation, 1: task, 2: role). Defaults to null, meaning returning all items regardless of their type.
CAuthItem$typethe item for which to get the select options.
array$excludethe items to be excluded.
Returns
array the select options.

Definition at line 200 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::getValidChildTypes (   $type)
static

Returns the valid child item types for a specific type.

Parameters
string$typethe item type (0: operation, 1: task, 2: role).
Returns
array the valid types.

Definition at line 159 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::module ( )
static
Returns
RightsModule the Rights module.

Definition at line 280 of file Rights.php.

Here is the call graph for this function:

Here is the caller graph for this function:

static Rights::powered ( )
static
Returns
string a string that can be displayed on your Web page showing Powered-by-Rights information.

Definition at line 270 of file Rights.php.

Here is the call graph for this function:

static Rights::revoke (   $itemName,
  $userId 
)
static

Revokes an authorization item from a specific user.

Parameters
string$itemNamethe name of the item to revoke.
integer$userIdthe user id of the user for which to revoke the item.
Returns
boolean whether the item was removed.

Definition at line 47 of file Rights.php.

Here is the call graph for this function:

static Rights::t (   $category,
  $message,
  $params = array(),
  $source = null,
  $language = null 
)
static

Translates a message to the specified language. Wrapper class for setting the category correctly.

Parameters
string$categorymessage category.
string$messagethe original message.
array$paramsparameters to be applied to the message using strtr.
string$sourcewhich message source application component to use.
string$languagethe target language.
Returns
string the translated message.

Definition at line 341 of file Rights.php.

Here is the caller graph for this function:

Member Data Documentation

Rights::$_a
staticprivate

Definition at line 19 of file Rights.php.

Rights::$_m
staticprivate

Definition at line 18 of file Rights.php.

const Rights::PERM_DIRECT = 1

Definition at line 15 of file Rights.php.

const Rights::PERM_INHERITED = 2

Definition at line 16 of file Rights.php.

const Rights::PERM_NONE = 0

Definition at line 14 of file Rights.php.


The documentation for this class was generated from the following file: