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');
35 public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_role_id,
$a_type, $a_show_admin_permissions =
false)
40 $rbacreview = $DIC[
'rbacreview'];
44 $this->show_admin_permissions = $a_show_admin_permissions;
46 parent::__construct($a_parent_obj, $a_parent_cmd);
48 $this->
setId(
'role_template_' . $a_ref_id .
'_' .
$a_type);
52 $this->lng->loadLanguageModule(
'rbac');
54 $this->ref_id = $a_ref_id;
55 $this->role_id = $a_role_id;
57 $this->
setRowTemplate(
"tpl.obj_role_template_perm_row.html",
"Services/AccessControl");
79 $this->show_change_existing_objects = $a_status;
98 $rbacreview = $DIC[
'rbacreview'];
100 if (self::$template_permissions !== null) {
103 self::$template_permissions = $rbacreview->getAllOperationsOfRole(
116 return self::$template_permissions[
$a_type] ? self::$template_permissions[
$a_type] : array();
181 $objDefinition = $DIC[
'objDefinition'];
183 if (isset(
$row[
'show_ce'])) {
184 $this->tpl->setCurrentBlock(
'ce_td');
186 $this->tpl->parseCurrentBlock();
188 $this->tpl->setCurrentBlock(
'ce_desc_td');
190 $this->tpl->setVariable(
'CE_LONG', $this->lng->txt(
'change_existing_object_type_desc'));
192 if ($objDefinition->isSystemObject($this->getTemplateType())) {
193 $this->tpl->setVariable(
195 $this->lng->txt(
"change_existing_prefix_single") .
" " .
197 $this->lng->txt(
"change_existing_suffix_single")
205 : $this->lng->txt(
'objs_' . $this->getTemplateType());
206 $this->tpl->setVariable(
208 $this->lng->txt(
'change_existing_prefix') .
' ' .
210 $this->lng->txt(
'change_existing_suffix')
212 $this->tpl->parseCurrentBlock();
216 $this->tpl->setCurrentBlock(
'perm_td');
218 $this->tpl->setVariable(
'PERM_PERM_ID',
$row[
'ops_id']);
219 $this->tpl->setVariable(
'PERM_CHECKED',
$row[
'set'] ?
'checked="checked"' :
'');
221 if ($this->
getRoleId() == SYSTEM_ROLE_ID) {
222 $this->tpl->setVariable(
'PERM_DISABLED',
'disabled="disabled"');
225 $this->tpl->parseCurrentBlock();
227 $this->tpl->setCurrentBlock(
'perm_desc_td');
229 $this->tpl->setVariable(
'DESC_PERM_ID',
$row[
'ops_id']);
231 if (
$row[
"create_type"] !=
"" && $objDefinition->isPlugin(
$row[
'create_type'])) {
232 $this->tpl->setVariable(
239 } elseif (
$row[
"create_type"] ==
"" && $objDefinition->isPlugin($this->getTemplateType())) {
240 $this->tpl->setVariable(
248 if (substr(
$row[
'name'], 0, 6) ==
'create') {
249 #$perm = $this->lng->txt($this->getTemplateType().'_'.$row['name']); 250 $perm = $this->lng->txt(
'rbac' .
'_' .
$row[
'name']);
251 } elseif ($this->lng->exists($this->getTemplateType() .
'_' .
$row[
'name'] .
'_short')) {
258 $this->tpl->setVariable(
'TXT_PERMISSION', $perm);
260 $this->tpl->parseCurrentBlock();
274 $rbacreview = $DIC[
'rbacreview'];
275 $objDefinition = $DIC[
'objDefinition'];
282 foreach ($rbacreview->getOperationsByTypeAndClass($this->getTemplateType(),
'object') as $ops_id) {
285 $operation = $rbacreview->getOperation($ops_id);
287 $perm[
'ops_id'] = $ops_id;
288 $perm[
'set'] = (in_array($ops_id, $operations)
or $this->
getRoleId() == SYSTEM_ROLE_ID);
289 $perm[
'name'] = $operation[
'operation'];
295 $objects = $objDefinition->getCreatableSubObjects($this->
getTemplateType());
299 $ops_id = $ops_ids[
$type];
305 $perm[
'ops_id'] = $ops_id;
306 $perm[
'set'] = (in_array($ops_id, $operations)
or $this->
getRoleId() == SYSTEM_ROLE_ID);
308 $perm[
'name'] =
'create_' .
$info[
'name'];
309 $perm[
'create_type'] =
$info[
'name'];
315 !$this->show_admin_permissions &&
318 $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.
setShowChangeExistingObjects($a_status)
getShowChangeExistingObjects()
$show_change_existing_objects
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.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
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.
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.
static $template_permissions
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
initTemplatePermissions()
setLimit($a_limit=0, $a_default_limit=0)