Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
RUserBehavior Class Reference

Public Member Functions

 getId ()
 getName ()
 getAssignmentNameLink ()
 getAssignmentsText ($type)
 getAssignments ()

Public Attributes

 $idColumn
 $nameColumn

Detailed Description

Rights user behavior class file.

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

Definition at line 9 of file RUserBehavior.php.

Member Function Documentation

RUserBehavior::getAssignmentNameLink ( )

Returns a link labeled with the username pointing to the users assignments.

Returns
string the link markup.

Definition at line 57 of file RUserBehavior.php.

{
return CHtml::link($this->getName(), array('assignment/user', 'id' => $this->getId()));
}
RUserBehavior::getAssignments ( )

Returns the authorization items assigned to the user.

Returns
string the assignments markup.

Definition at line 90 of file RUserBehavior.php.

References Rights\getAuthorizer().

{
if ($this->_assignments!==null) {
return $this->_assignments;
} else {
$authorizer = Rights::getAuthorizer();
$authAssignments = $authorizer->authManager->getAuthAssignments($this->getId());
$nestedItems = $authorizer->authManager->getAuthItemsByNames(array_keys($authAssignments), true);
$assignments = array();
foreach ($nestedItems as $type => $items) {
$items = $authorizer->attachAuthItemBehavior($items);
$assignments[$type] = array();
foreach ($items as $itemName => $item) {
$assignments[$type][$itemName] = $item;
}
}
return $this->_assignments = $assignments;
}
}
RUserBehavior::getAssignmentsText (   $type)

Returns a string with names of the authorization items of the given type that are assigned to this user.

Parameters
integer$typethe item type (0: operation, 1: task, 2: role).
Returns
mixed the assigned items.

Definition at line 70 of file RUserBehavior.php.

{
$assignedItems = $this->getAssignments();
if (isset($assignedItems[$type])===true) {
$items = $assignedItems[$type];
$names = array();
foreach ($items as $itemname => $item) {
$names[] = $item->getNameText();
}
return implode('<br />', $names);
}
}
RUserBehavior::getId ( )

Returns the value of the owner's id column. Attribute name is retrived from the module configuration.

Returns
string the id.

Definition at line 28 of file RUserBehavior.php.

References Rights\module().

{
if ($this->idColumn===null) {
$this->idColumn = Rights::module()->userIdColumn;
}
return $this->owner->{$this->idColumn};
}
RUserBehavior::getName ( )

Returns the value of the owner's name column. Attribute name is retrived from the module configuration.

Returns
string the name.

Definition at line 43 of file RUserBehavior.php.

References Rights\module().

{
if ($this->nameColumn===null) {
$this->nameColumn = Rights::module()->userNameColumn;
}
return $this->owner->{$this->nameColumn};
}

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