CommonDBTM::getRights PHP Method

getRights() public method

Get rights for an item _ may be overload by object
public getRights ( $interface = 'central' ) : array
$interface string (defalt 'central')
return array of rights to display
    function getRights($interface = 'central')
    {
        $values = array(CREATE => __('Create'), READ => __('Read'), UPDATE => __('Update'), PURGE => array('short' => __('Purge'), 'long' => _x('button', 'Delete permanently')));
        $values += ObjectLock::getRightsToAdd(get_class($this), $interface);
        if ($this->maybeDeleted()) {
            $values[DELETE] = array('short' => __('Delete'), 'long' => _x('button', 'Put in dustbin'));
        }
        if ($this->usenotepad) {
            $values[READNOTE] = array('short' => __('Read notes'), 'long' => __("Read the item's notes"));
            $values[UPDATENOTE] = array('short' => __('Update notes'), 'long' => __("Update the item's notes"));
        }
        return $values;
    }

Usage Example

 /**
  * @since version 0.85
  *
  * @see commonDBTM::getRights()
  **/
 function getRights($interface = 'central')
 {
     $values = parent::getRights();
     $values[self::HOMEPAGE] = __('See in homepage', 'monitoring');
     $values[self::DASHBOARD] = __('See in dashboard', 'monitoring');
     return $values;
 }
All Usage Examples Of CommonDBTM::getRights
CommonDBTM