4 include_once (
'./Services/Table/classes/class.ilTable2GUI.php');
5 include_once
'./Services/AccessControl/classes/class.ilPermissionGUI.php';
6 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
34 public function __construct($a_parent_obj,$a_parent_cmd, $a_ref_id,$a_role_id,
$a_type,$a_show_admin_permissions =
false)
39 $this->show_admin_permissions = $a_show_admin_permissions;
41 parent::__construct($a_parent_obj,$a_parent_cmd);
48 $this->lng->loadLanguageModule(
'rbac');
50 $this->ref_id = $a_ref_id;
51 $this->role_id = $a_role_id;
53 $this->
setRowTemplate(
"tpl.obj_role_template_perm_row.html",
"Services/AccessControl");
79 if(self::$template_permissions !== NULL)
83 self::$template_permissions = $rbacreview->getAllOperationsOfRole(
96 return self::$template_permissions[
$a_type] ? self::$template_permissions[
$a_type] :
array();
159 global $objDefinition;
161 if(isset(
$row[
'show_ce']))
163 $this->tpl->setCurrentBlock(
'ce_td');
165 $this->tpl->parseCurrentBlock();
167 $this->tpl->setCurrentBlock(
'ce_desc_td');
169 $this->tpl->setVariable(
'CE_LONG',$this->lng->txt(
'change_existing_object_type_desc'));
171 if($objDefinition->isSystemObject($this->getTemplateType()))
173 $this->tpl->setVariable(
"TXT_CE",
174 $this->lng->txt(
"change_existing_prefix_single").
" ".
176 $this->lng->txt(
"change_existing_suffix_single")
183 "objs_".$this->getTemplateType())
184 : $this->lng->txt(
'objs_'.$this->getTemplateType());
186 $this->tpl->setVariable(
'TXT_CE',
187 $this->lng->txt(
'change_existing_prefix').
' '.
189 $this->lng->txt(
'change_existing_suffix'));
190 $this->tpl->parseCurrentBlock();
196 $this->tpl->setCurrentBlock(
'perm_td');
198 $this->tpl->setVariable(
'PERM_PERM_ID',
$row[
'ops_id']);
199 $this->tpl->setVariable(
'PERM_CHECKED',
$row[
'set'] ?
'checked="checked"' :
'');
203 $this->tpl->setVariable(
'PERM_DISABLED',
'disabled="disabled"');
206 $this->tpl->parseCurrentBlock();
208 $this->tpl->setCurrentBlock(
'perm_desc_td');
210 $this->tpl->setVariable(
'DESC_PERM_ID',
$row[
'ops_id']);
212 if (
$row[
"create_type"] !=
"" && $objDefinition->isPlugin(
$row[
'create_type']))
214 $this->tpl->setVariable(
'TXT_PERMISSION',
218 else if (
$row[
"create_type"] ==
"" && $objDefinition->isPlugin($this->getTemplateType()))
220 $this->tpl->setVariable(
'TXT_PERMISSION',
226 if(substr(
$row[
'name'],0,6) ==
'create')
228 #$perm = $this->lng->txt($this->getTemplateType().'_'.$row['name']); 229 $perm = $this->lng->txt(
'rbac'.
'_'.
$row[
'name']);
231 elseif($this->lng->exists($this->getTemplateType().
'_'.
$row[
'name'].
'_short'))
241 $this->tpl->setVariable(
'TXT_PERMISSION',$perm);
243 $this->tpl->parseCurrentBlock();
255 global $rbacreview, $objDefinition;
262 foreach($rbacreview->getOperationsByTypeAndClass($this->getTemplateType(),
'object') as $ops_id)
266 $operation = $rbacreview->getOperation($ops_id);
268 $perm[
'ops_id'] = $ops_id;
269 $perm[
'set'] = (in_array($ops_id,$operations)
or $this->
getRoleId() == SYSTEM_ROLE_ID);
270 $perm[
'name'] = $operation[
'operation'];
276 $objects = $objDefinition->getCreatableSubObjects($this->
getTemplateType());
279 foreach($objects as $type =>
$info)
281 $ops_id = $ops_ids[$type];
288 $perm[
'ops_id'] = $ops_id;
289 $perm[
'set'] = (in_array($ops_id,$operations)
or $this->
getRoleId() == SYSTEM_ROLE_ID);
291 $perm[
'name'] =
'create_'.$info[
'name'];
292 $perm[
'create_type'] =
$info[
'name'];
297 if(!$this->show_admin_permissions)
299 $rows[] =
array(
'show_ce' => 1);
getRoleId()
Get currrent role id.
static lookupTxtById($plugin_id, $lang_var)
getTemplateType()
get current tempalte type
__construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_role_id, $a_type, $a_show_admin_permissions=false)
Constructor.
Table for object role permissions.
setNoEntriesText($a_text)
Set text for an empty table.
parse()
Parse permissions.
fillRow($row)
Fill row template.
static lookupCreateOperationIds($a_type_arr)
Lookup operation ids.
getRefId()
Get ref id of current object.
getPermissions($a_type)
Get permissions by type.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
static _lookupObjId($a_id)
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
disable($a_module_name)
diesables particular modules of table
initTemplateType($a_type)
Set object type for current template permission table.
setFormName($a_formname="")
Set Form name.
static $template_permissions
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
initTemplatePermissions()
setLimit($a_limit=0, $a_default_limit=0)