40 $ilCtrl =
$DIC[
'ilCtrl'];
42 $rbacsystem =
$DIC[
'rbacsystem'];
44 $this->
factory = $DIC->ui()->factory();
45 $this->
renderer = $DIC->ui()->renderer();
46 $this->
access = $DIC[
'ilAccess'];
49 $this->
setId(
"usrroleass");
59 $this->
addColumn($this->
lng->txt(
"description"),
"description");
62 $this->edit_access = $rbacsystem->checkAccess(
"edit_roleassignment",
USER_FOLDER_ID);
65 $this->
setRowTemplate(
"tpl.role_assignment_row.html",
"components/ILIAS/User");
68 if ($this->edit_access) {
91 $option[0] =
$lng->
txt(
'assigned_roles');
92 $option[1] =
$lng->
txt(
'all_roles');
93 $option[2] =
$lng->
txt(
'all_global_roles');
94 $option[3] =
$lng->
txt(
'all_local_roles');
95 $option[4] =
$lng->
txt(
'internal_local_roles_only');
96 $option[5] =
$lng->
txt(
'non_internal_local_roles_only');
98 if ($this->edit_access) {
100 $si->setOptions($option);
102 $si->readFromSession();
103 $this->
filter[
"role_filter"] = $si->getValue();
105 $this->
filter[
"role_filter"] = 0;
109 protected function fillRow(array $a_set): void
111 if ($this->edit_access) {
112 if (isset($a_set[
'checkbox'][
'id'])) {
113 $this->tpl->setVariable(
'VAL_ID', $a_set[
'checkbox'][
'id']);
114 if ($a_set[
'checkbox'][
'disabled']) {
115 $this->tpl->setVariable(
'VAL_DISABLED',
'disabled="disabled"');
117 if ($a_set[
'checkbox'][
'checked']) {
118 $this->tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
123 $this->
ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $a_set[
'ref_id']);
124 $this->
ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $a_set[
"obj_id"]);
127 if ($this->
access->checkAccess(
'edit_permission',
'', (
int) $a_set[
'ref_id'])) {
129 $this->
factory->link()->standard(
131 $this->ctrl->getLinkTargetByClass(ilObjRoleGUI::class,
'perm')
135 $this->tpl->setVariable(
'ROLE', $role);
136 $this->tpl->setVariable(
'DESCRIPTION', $a_set[
'description']);
139 if ($a_set[
'role_type'] ===
'local' &&
140 ($this->
access->checkAccess(
'visible',
'', (
int) $a_set[
'ref_id']) ||
141 $this->access->checkAccess(
'read',
'', (
int) $a_set[
'ref_id']))) {
143 $this->
factory->link()->standard(
152 $this->tpl->setVariable(
'CONTEXT',
$context);
153 $this->tpl->setVariable(
'PATH', $a_set[
'path']);
156 public function parse(
int $usr_id): void
159 $rbacreview =
$DIC->rbac()->review();
160 $tree =
$DIC->repositoryTree();
161 $ilUser =
$DIC->user();
164 $assigned_roles = $rbacreview->assignedRoles($usr_id);
169 foreach ($rbacreview->getRolesByFilter((
int) $this->filter[
'role_filter'], $usr_id) as $role) {
171 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
172 $ref_id = $rbacreview->getObjectReferenceOfRole($role[
'rol_id']);
175 if ($rbacreview->isDeleted($rolf[0])) {
180 if ($tree->isInTree($rolf[0])) {
184 $tmpPath = $tree->getPathFull($rolf[0]);
188 $context =
"<b>Rolefolder " . $rolf[0] .
" not found in tree! (Role " . $role[
"obj_id"] .
")</b>";
207 if (strpos($role[
"title"],
"il_") === 0) {
209 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
210 $rolf2 = $rolf_arr[0];
215 $parent_node = $tree->getNodeData($rolf2);
216 if (!isset($parent_node[
'type']) || !isset($parent_node[
'obj_id'])) {
219 $role[
'description'] =
"{$this->lng->txt("obj_{$parent_node[
'type']}
")} (#{$parent_node['obj_id']})";
222 $role_ids[
$counter] = $role[
"obj_id"];
225 'id' => $role[
'obj_id'],
226 'disabled' => $disabled,
227 'checked' => in_array($role[
'obj_id'], $assigned_roles)
233 "description" => $role[
"description"],
235 "checkbox" => $checkbox,
236 "role_type" => $role[
"role_type"],
238 "obj_id" => $role[
"obj_id"],
254 return $this->
lng->txt(
'obj_' . $type);
267 $title = $list->getTitle();
Class ilAccessHandler Checks access for ILIAS objects.
static resetToDefaults()
reset to defaults
static setUseRelativeDates(bool $a_status)
set use relative dates
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _getTranslation(string $a_role_title)
parses the objects.xml it handles the xml-description of all ilias objects
Base exception class for object service.
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRow(array $a_set)
Standard Version of Fill Row.
ilObjectDefinition $objectDefinition
ILIAS UI Factory $factory
__construct(object $a_parent_obj, string $a_parent_cmd)
getTitleForReference(int $ref_id)
ILIAS UI Renderer $renderer
static _getInstance()
Get instance of ilSecuritySettings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setEnableTitle(bool $a_enabletitle)
addMultiCommand(string $a_cmd, string $a_text)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setDisableFilterHiding(bool $a_val=true)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)