19 declare(strict_types=1);
47 bool $a_show_admin_permissions =
false 51 $this->review = $DIC->rbac()->review();
52 $this->objDefinition = $DIC[
'objDefinition'];
54 $this->tpl_type = $a_type;
55 $this->show_admin_permissions = $a_show_admin_permissions;
57 $this->
setId(
'role_template_' . $a_ref_id .
'_' . $a_type);
62 $this->
lng->loadLanguageModule(
'rbac');
64 $this->ref_id = $a_ref_id;
65 $this->role_id = $a_role_id;
67 $this->
setRowTemplate(
"tpl.obj_role_template_perm_row.html",
"components/ILIAS/AccessControl");
86 $this->show_change_existing_objects = $a_status;
96 if (self::$template_permissions !==
null) {
99 self::$template_permissions = $this->review->getAllOperationsOfRole(
110 return !isset(self::$template_permissions[$a_type]) ? [] : self::$template_permissions[$a_type];
138 protected function fillRow(array $a_set): void
140 if (isset($a_set[
'show_ce'])) {
141 $this->tpl->setCurrentBlock(
'ce_td');
143 $this->tpl->parseCurrentBlock();
145 $this->tpl->setCurrentBlock(
'ce_desc_td');
147 $this->tpl->setVariable(
'CE_LONG', $this->
lng->txt(
'change_existing_object_type_desc'));
149 if ($this->objDefinition->isSystemObject($this->getTemplateType())) {
150 $this->tpl->setVariable(
152 $this->
lng->txt(
"change_existing_prefix_single") .
" " .
154 $this->
lng->txt(
"change_existing_suffix_single")
162 : $this->
lng->txt(
'objs_' . $this->getTemplateType());
163 $this->tpl->setVariable(
165 $this->
lng->txt(
'change_existing_prefix') .
' ' .
167 $this->
lng->txt(
'change_existing_suffix')
169 $this->tpl->parseCurrentBlock();
172 $this->tpl->setCurrentBlock(
'perm_td');
174 $this->tpl->setVariable(
'PERM_PERM_ID', $a_set[
'ops_id']);
175 $this->tpl->setVariable(
'PERM_CHECKED', $a_set[
'set'] ?
'checked="checked"' :
'');
178 $this->tpl->setVariable(
'PERM_DISABLED',
'disabled="disabled"');
181 $this->tpl->parseCurrentBlock();
183 $this->tpl->setCurrentBlock(
'perm_desc_td');
185 $this->tpl->setVariable(
'DESC_PERM_ID', $a_set[
'ops_id']);
187 $create_type = $a_set[
"create_type"] ??
"";
188 if ($create_type !=
"" && $this->objDefinition->isPlugin($a_set[
'create_type'])) {
189 $this->tpl->setVariable(
192 $a_set[
'create_type'],
196 } elseif ($create_type ==
"" && $this->objDefinition->isPlugin($this->getTemplateType())) {
197 $this->tpl->setVariable(
205 if (substr($a_set[
'name'], 0, 6) ==
'create') {
206 #$perm = $this->lng->txt($this->getTemplateType().'_'.$row['name']); 207 $perm = $this->
lng->txt(
'rbac' .
'_' . $a_set[
'name']);
208 } elseif ($this->
lng->exists($this->getTemplateType() .
'_' . $a_set[
'name'] .
'_short')) {
209 $perm = $this->
lng->txt($this->
getTemplateType() .
'_' . $a_set[
'name'] .
'_short') .
': ' .
212 $perm = $this->
lng->txt($a_set[
'name']) .
': ' . $this->
lng->txt($this->
getTemplateType() .
'_' . $a_set[
'name']);
215 $this->tpl->setVariable(
'TXT_PERMISSION', $perm);
217 $this->tpl->parseCurrentBlock();
231 foreach ($this->review->getOperationsByTypeAndClass($this->getTemplateType(),
'object') as $ops_id) {
234 $operation = $this->review->getOperation($ops_id);
236 $perm[
'ops_id'] = $ops_id;
238 $perm[
'name'] = $operation[
'operation'];
244 $objects = $this->objDefinition->getCreatableSubObjects($this->
getTemplateType());
247 foreach ($objects as $type => $info) {
248 $ops_id = $ops_ids[$type] ??
null;
254 $perm[
'ops_id'] = $ops_id;
257 $perm[
'name'] =
'create_' . $info[
'name'];
258 $perm[
'create_type'] = $info[
'name'];
264 !$this->show_admin_permissions &&
267 $rows[] = [
'show_ce' => 1];
setNoEntriesText(string $a_text)
Table for object role permissions.
getShowChangeExistingObjects()
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setDisableFilterHiding(bool $a_val=true)
setShowChangeExistingObjects(bool $a_status)
bool $show_admin_permissions
setFormName(string $a_name="")
parse()
Parse permissions.
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static lookupCreateOperationIds(array $a_type_arr)
Lookup operation ids.
ilObjectDefinition $objDefinition
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
bool $show_change_existing_objects
static lookupTxtById(string $plugin_id, string $lang_var)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
disable(string $a_module_name)
static _lookupType(int $id, bool $reference=false)
static array $template_permissions
__construct(object $a_parent_obj, string $a_parent_cmd, int $a_ref_id, int $a_role_id, string $a_type, bool $a_show_admin_permissions=false)
getPermissions(string $a_type)
Get permissions by type.
setEnableHeader(bool $a_enableheader)
initTemplatePermissions()