38 $ilCtrl = $DIC[
'ilCtrl'];
40 $rbacsystem = $DIC[
'rbacsystem'];
42 $this->factory = $DIC->ui()->factory();
43 $this->renderer = $DIC->ui()->renderer();
47 $this->
setId(
"usrroleass");
57 $this->
addColumn($this->
lng->txt(
"description"),
"description");
62 $this->
setRowTemplate(
"tpl.role_assignment_row.html",
"Services/User");
65 if ($rbacsystem->checkAccess(
"edit_roleassignment",
USER_FOLDER_ID)) {
88 $option[0] =
$lng->
txt(
'assigned_roles');
89 $option[1] =
$lng->
txt(
'all_roles');
90 $option[2] =
$lng->
txt(
'all_global_roles');
91 $option[3] =
$lng->
txt(
'all_local_roles');
92 $option[4] =
$lng->
txt(
'internal_local_roles_only');
93 $option[5] =
$lng->
txt(
'non_internal_local_roles_only');
96 $si->setOptions($option);
98 $si->readFromSession();
99 $this->
filter[
"role_filter"] = $si->getValue();
102 protected function fillRow(array $a_set): void
104 if (isset($a_set[
'checkbox'][
'id'])) {
105 $this->tpl->setVariable(
'VAL_ID', $a_set[
'checkbox'][
'id']);
106 if ($a_set[
'checkbox'][
'disabled']) {
107 $this->tpl->setVariable(
'VAL_DISABLED',
'disabled="disabled"');
109 if ($a_set[
'checkbox'][
'checked']) {
110 $this->tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
114 $this->
ctrl->setParameterByClass(
"ilobjrolegui",
"ref_id", $a_set[
'ref_id']);
115 $this->
ctrl->setParameterByClass(
"ilobjrolegui",
"obj_id", $a_set[
"obj_id"]);
117 $this->tpl->setVariable(
119 $this->renderer->render(
120 $this->factory->link()->standard(
122 $this->
ctrl->getLinkTargetByClass(ilObjRoleGUI::class,
'perm')
126 $this->tpl->setVariable(
'DESCRIPTION', $a_set[
'description']);
129 if ($a_set[
'role_type'] ===
'local') {
131 $this->factory->link()->standard(
140 $this->tpl->setVariable(
'CONTEXT',
$context);
141 $this->tpl->setVariable(
'PATH', $a_set[
'path']);
144 public function parse(
int $usr_id): void
148 $rbacreview = $DIC->rbac()->review();
149 $tree = $DIC->repositoryTree();
153 $assigned_roles = $rbacreview->assignedRoles($usr_id);
158 foreach ($rbacreview->getRolesByFilter((
int) $this->filter[
'role_filter'], $usr_id) as $role) {
160 $rolf = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
161 $ref_id = $rbacreview->getObjectReferenceOfRole($role[
'rol_id']);
164 if ($rbacreview->isDeleted($rolf[0])) {
169 if ($tree->isInTree($rolf[0])) {
173 $tmpPath = $tree->getPathFull($rolf[0]);
177 $context =
"<b>Rolefolder " . $rolf[0] .
" not found in tree! (Role " . $role[
"obj_id"] .
")</b>";
184 (!in_array(SYSTEM_ROLE_ID, $rbacreview->assignedRoles(
$ilUser->getId())) && $role[
"obj_id"] === (
int) SYSTEM_ROLE_ID)
190 if ($role[
'obj_id'] == SYSTEM_ROLE_ID && !$rbacreview->isAssigned(
$ilUser->getId(),
SYSTEM_ROLE_ID)) {
196 if (strpos($role[
"title"],
"il_") === 0) {
198 $rolf_arr = $rbacreview->getFoldersAssignedToRole($role[
"obj_id"],
true);
199 $rolf2 = $rolf_arr[0];
204 $parent_node = $tree->getNodeData($rolf2);
206 $role[
"description"] = $this->
lng->txt(
"obj_" . $parent_node[
"type"]) .
" (#" . $parent_node[
"obj_id"] .
")";
209 $role_ids[$counter] = $role[
"obj_id"];
212 'id' => $role[
'obj_id'],
213 'disabled' => $disabled,
214 'checked' => in_array($role[
'obj_id'], $assigned_roles)
220 "description" => $role[
"description"],
222 "checkbox" => $checkbox,
223 "role_type" => $role[
"role_type"],
225 "obj_id" => $role[
"obj_id"],
241 return $this->
lng->txt(
'obj_' .
$type);
254 $title = $list->getTitle();
Creates a path for a start and endnode.
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
ILIAS UI Renderer $renderer
setEnableTitle(bool $a_enabletitle)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDisableFilterHiding(bool $a_val=true)
static resetToDefaults()
reset to defaults
loadLanguageModule(string $a_module)
Load language module.
ILIAS UI Factory $factory
static _lookupObjId(int $ref_id)
__construct(object $a_parent_obj, string $a_parent_cmd)
parses the objects.xml it handles the xml-description of all ilias objects
static _lookupTitle(int $obj_id)
setDefaultOrderField(string $a_defaultorderfield)
static _getTranslation(string $a_role_title)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
getTitleForReference(int $ref_id)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectDefinition $objectDefinition
__construct(Container $dic, ilPlugin $plugin)
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)
static _lookupType(int $id, bool $reference=false)
static setUseRelativeDates(bool $a_status)
set use relative dates
addMultiCommand(string $a_cmd, string $a_text)
static _getInstance()
Get instance of ilSecuritySettings.
setEnableHeader(bool $a_enableheader)