19 declare(strict_types=1);
57 bool $a_call_by_reference =
false,
58 bool $a_prepare_output =
true 63 $this->rbacadmin = $DIC[
'rbacadmin'];
64 $this->
help = $DIC[
'ilHelp'];
65 $this->
logger = $DIC->logger()->ac();
67 $this->role_id = $a_id;
68 $this->
http = $DIC[
'http'];
70 $this->ui_factory = $DIC[
'ui.factory'];
71 $this->ui_renderer = $DIC[
'ui.renderer'];
81 $this->
ctrl->saveParameter($this, [
'obj_id',
'rolf_ref_id']);
82 $this->
lng->loadLanguageModule(
'rbac');
89 $next_class = $this->
ctrl->getNextClass($this);
90 $cmd = $this->
ctrl->getCmd();
94 switch ($next_class) {
95 case 'ilrepositorysearchgui':
97 if (!$this->
access->checkAccess(
'edit_permission',
'', $this->obj_ref_id)) {
98 $this->error->raiseError(
99 $this->
lng->txt(
'permission_denied'),
100 $this->error->WARNING
104 $rep_search->setTitle($this->
lng->txt(
'role_add_user'));
105 $rep_search->setCallback($this,
'addUserObject');
108 $this->tabs_gui->setTabActive(
'user_assignment');
109 $this->
ctrl->setReturn($this,
'userassignment');
110 $ret = $this->
ctrl->forwardCommand($rep_search);
115 $this->tabs_gui->setTabActive(
'export');
121 $exp->addFormat(
'xml');
122 $this->
ctrl->forwardCommand($exp);
125 case 'ilrecommendedcontentroleconfiggui':
126 $this->tabs_gui->setTabActive(
'rep_recommended_content');
128 $this->
ctrl->forwardCommand($ui);
136 $cmd =
'userassignment';
153 $this->obj_ref_id = 0;
155 if ($this->
http->wrapper()->query()->has(
'rolf_ref_id')) {
156 $this->obj_ref_id = $this->
http->wrapper()->query()->retrieve(
160 } elseif ($this->
http->wrapper()->query()->has(
'ref_id')) {
161 $this->obj_ref_id = $this->
http->wrapper()->query()->retrieve(
170 $template_permissions = [];
171 if ($this->
http->wrapper()->post()->has(
'template_perm')) {
172 $custom_transformer = $this->
refinery->custom()->transformation(
177 $template_permissions = $this->
http->wrapper()->post()->retrieve(
182 return $template_permissions;
231 || $this->obj_definition->isAdministrationObject($this->
getContainerType());
238 if ($this->creation_mode) {
239 $this->
ctrl->setParameter($this,
"new_type",
'role');
241 $form->setFormAction($this->
ctrl->getFormAction($this));
244 case self::MODE_GLOBAL_CREATE:
245 $form->setTitle($this->
lng->txt(
'role_new'));
246 $form->addCommandButton(
'save', $this->
lng->txt(
'role_new'));
249 case self::MODE_GLOBAL_UPDATE:
250 $form->setTitle($this->
lng->txt(
'role_edit'));
251 $form->addCommandButton(
'update', $this->
lng->txt(
'save'));
254 case self::MODE_LOCAL_CREATE:
255 case self::MODE_LOCAL_UPDATE:
258 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
262 $title->setDisabled(
true);
265 $title->setValidationRegexp(
'/^(?!il_).*$/');
266 $title->setValidationFailureMessage($this->
lng->txt(
'msg_role_reserved_prefix'));
270 $title->setMaxLength(70);
271 $title->setRequired(
true);
272 $form->addItem($title);
280 $form->addItem($desc);
282 if ($a_mode != self::MODE_LOCAL_CREATE && $a_mode != self::MODE_GLOBAL_CREATE) {
284 $form->addItem($ilias_id);
290 #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info')); 291 $form->addItem($reg);
295 #$la->setInfo($this->lng->txt('rbac_local_admin_info')); 301 #$pro->setInfo($this->lng->txt('role_protext_permission_info')); 302 $form->addItem($pro);
330 $rbacreview = $DIC[
'rbacreview'];
335 $data[
'reg'] = $role->getAllowRegister();
336 $data[
'la'] = $role->getAssignUsersStatus();
337 $data[
'pro'] = $rbacreview->isProtected($this->obj_ref_id, $role->
getId());
348 if (!$this->rbac_system->checkAccess(
'create_role', $this->obj_ref_id)) {
349 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
350 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
353 $this->tpl->setContent($form->getHTML());
358 if (!$this->
checkAccess(
'write',
'edit_permission')) {
359 $this->tpl->setOnScreenMessage(
'msg_no_perm_write', $this->
lng->txt(
'permission_denied'),
true);
360 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
362 $this->tabs_gui->activateTab(
'edit_properties');
366 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
367 if ($this->rbac_review->isDeleteable($this->object->getId(),
$this->obj_ref_id)) {
369 $this->ui_factory->link()->standard(
370 $this->
lng->txt(
'rbac_delete_role'),
371 $this->
ctrl->getLinkTarget($this,
'confirmDeleteRole')
378 $this->tpl->setContent($form->getHTML());
388 if ($form->checkInput()) {
393 $this->rbacadmin->setProtected(
396 $form->getInput(
'pro') ?
'y' :
'n' 398 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"role_added"),
true);
399 $this->
ctrl->setParameter($this,
'obj_id', $role->getId());
400 $this->
ctrl->redirect($this,
'perm');
403 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
404 $form->setValuesByPost();
405 $this->tpl->setContent($form->getHTML());
415 if ($form->checkInput()) {
417 $this->
object->update();
418 $this->rbacadmin->setProtected(
421 $form->getInput(
'pro') ?
'y' :
'n' 423 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"saved_successfully"),
true);
424 $this->
ctrl->redirect($this,
'edit');
427 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
428 $form->setValuesByPost();
429 $this->tpl->setContent($form->getHTML());
432 protected function permObject(
bool $a_show_admin_permissions =
false): void
434 $this->tabs_gui->setTabActive(
'default_perm_settings');
438 if ($a_show_admin_permissions) {
439 $this->tabs_gui->setSubTabActive(
'rbac_admin_permissions');
441 $this->tabs_gui->setSubTabActive(
'rbac_repository_permissions');
444 if (!$this->
checkAccess(
'write',
'edit_permission')) {
445 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'),
true);
446 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
451 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
453 $this->ui_factory->link()->standard(
454 $this->
lng->txt(
"adopt_perm_from_template"),
455 $this->
ctrl->getLinkTarget($this,
'adoptPerm')
458 if ($this->rbac_review->isDeleteable($this->object->getId(),
$this->obj_ref_id)) {
460 $this->ui_factory->link()->standard(
461 $this->
lng->txt(
'rbac_delete_role'),
462 $this->
ctrl->getLinkTarget($this,
'confirmDeleteRole')
468 $this->tpl->addBlockFile(
471 'tpl.rbac_template_permissions.html',
472 'Services/AccessControl' 475 $this->tpl->setVariable(
'PERM_ACTION', $this->
ctrl->getFormAction($this));
482 if ($a_show_admin_permissions) {
483 $subs = ilObjRole::getSubObjects(
'adm',
true);
485 $subs = ilObjRole::getSubObjects(
'root',
false);
488 $subs = ilObjRole::getSubObjects($this->
getParentType(), $a_show_admin_permissions);
491 foreach ($subs as $subtype => $def) {
498 $a_show_admin_permissions
502 $acc->addItem($def[
'translation'], $tbl->getHTML());
505 $this->tpl->setVariable(
'ACCORDION', $acc->getHTML());
513 $a_show_admin_permissions
517 $a_show_admin_permissions ?
'adminPermSave' :
'permSave',
518 $this->
lng->txt(
'save')
523 $this->tpl->setVariable(
'OPTIONS_TABLE', $options->getHTML());
546 $parent_role_ids = $this->rbac_review->getParentRoleIds($this->obj_ref_id,
true);
548 $this->tabs_gui->clearTargets();
551 foreach (array_keys($parent_role_ids) as
$id) {
555 $sorted_ids =
ilUtil::_sortIds($ids,
'object_data',
'type,title',
'obj_id');
557 foreach ($sorted_ids as $id) {
558 $par = $parent_role_ids[
$id];
560 $output[
$key][
"role_id"] = $par[
"obj_id"];
561 $output[
$key][
"type"] = ($par[
"type"] ==
'role' ? $this->
lng->txt(
'obj_role') : $this->
lng->txt(
'obj_rolt'));
563 $output[
$key][
"role_desc"] = $par[
"desc"];
569 $tbl->setTitle($this->
lng->txt(
"adopt_perm_from_template"));
570 $tbl->setData($output);
572 $this->tpl->setContent($tbl->getHTML());
580 $this->tabs_gui->clearTargets();
582 if (!$this->
checkAccess(
'visible,write',
'edit_permission')) {
583 $this->tpl->setOnScreenMessage(
'msg_no_perm_perm', $this->
lng->txt(
'permission_denied'),
true);
584 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
587 $question = $this->
lng->txt(
'rbac_role_delete_qst');
588 if ($this->rbac_review->isAssigned($this->user->getId(), $this->
object->getId())) {
589 $question .= (
'<br />' . $this->
lng->txt(
'rbac_role_delete_self'));
591 $this->tpl->setOnScreenMessage(
'question', $question);
594 $confirm->setFormAction($this->
ctrl->getFormAction($this));
595 $confirm->setHeaderText($question);
596 $confirm->setCancel($this->
lng->txt(
'cancel'),
'perm');
597 $confirm->setConfirm($this->
lng->txt(
'rbac_delete_role'),
'performDeleteRole');
601 (
string) $this->
object->getId(),
606 $this->tpl->setContent($confirm->getHTML());
614 if (!$this->
checkAccess(
'visible,write',
'edit_permission')) {
615 $this->tpl->setOnScreenMessage(
'msg_no_perm_perm', $this->
lng->txt(
'permission_denied'),
true);
616 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
619 $this->
object->setParent($this->obj_ref_id);
620 $this->
object->delete();
621 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_deleted_role'),
true);
623 $this->
ctrl->returnToParent($this);
632 if (!$this->
checkAccess(
'visible,write',
'edit_permission')) {
633 $this->tpl->setOnScreenMessage(
'msg_no_perm_perm', $this->
lng->txt(
'permission_denied'),
true);
634 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
639 if ($rbac_log_active) {
645 if ($a_show_admin_permissions) {
646 $subs = ilObjRole::getSubObjects(
'adm',
true);
648 $subs = ilObjRole::getSubObjects(
'root',
false);
651 $subs = ilObjRole::getSubObjects($this->
getParentType(), $a_show_admin_permissions);
654 foreach (array_keys($subs) as $subtype) {
660 foreach ($template_permissions as
$key => $ops_array) {
665 if ($rbac_log_active) {
672 $this->
object->update();
676 if ($this->
http->wrapper()->post()->has(
'protected')) {
677 $protected = $this->
http->wrapper()->post()->retrieve(
685 $this->rbacadmin->setProtected($this->obj_ref_id, $this->
object->getId(),
ilUtil::tf2yn($protected));
688 if ($this->
http->wrapper()->post()->has(
'recursive')) {
689 $recursive = $this->
http->wrapper()->post()->retrieve(
695 $recursive_list = [];
696 if ($this->
http->wrapper()->post()->has(
'recursive_list')) {
697 $recursive_list = $this->
http->wrapper()->post()->retrieve(
699 $this->
refinery->kindlyTo()->listOf(
700 $this->
refinery->kindlyTo()->string()
704 if ($a_show_admin_permissions) {
709 if (!$recursive && !count($recursive_list)) {
710 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"saved_successfully"),
true);
711 if ($a_show_admin_permissions) {
712 $this->
ctrl->redirect($this,
'adminPerm');
714 $this->
ctrl->redirect($this,
'perm');
719 ($recursive || count($recursive_list)) &&
721 !$a_show_admin_permissions
728 if ($a_show_admin_permissions) {
729 $start = $this->tree->getParentId($this->obj_ref_id);
733 $this->
object->changeExistingObjects(
740 $this->
object->changeExistingObjects(
747 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"saved_successfully"),
true);
749 if ($a_show_admin_permissions) {
750 $this->
ctrl->redirect($this,
'adminPerm');
752 $this->
ctrl->redirect($this,
'perm');
759 if ($this->
http->wrapper()->post()->has(
'adopt')) {
760 $source = $this->
http->wrapper()->post()->retrieve(
767 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
774 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
776 if ($this->
object->getId() == $source) {
777 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_perm_adopted_from_itself"),
true);
780 $parentRoles = $this->rbac_review->getParentRoleIds($this->obj_ref_id,
true);
781 $this->rbacadmin->copyRoleTemplatePermissions(
783 $parentRoles[$source][
"parent"],
790 $this->
object->update();
794 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_perm_adopted_from1") .
" '" .
796 $this->
lng->txt(
"msg_perm_adopted_from2"),
true);
799 $this->
ctrl->redirect($this,
"perm");
807 if (!$this->
checkAccess(
'edit_userassignment',
'edit_permission')) {
808 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_assign_user_to_role'),
true);
811 if (!$this->rbac_review->isAssignable($this->object->getId(),
$this->obj_ref_id) &&
813 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_role_not_assignable'),
true);
816 if ($a_user_ids === []) {
817 $this->
lng->loadLanguageModule(
'search');
818 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'search_err_user_not_exist'),
true);
822 $assigned_users_all = $this->rbac_review->assignedUsers($this->
object->getId());
825 $assigned_users_new = array_diff($a_user_ids, array_intersect($a_user_ids, $assigned_users_all));
828 if (count($assigned_users_new) == 0) {
829 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"rbac_msg_user_already_assigned"),
true);
830 $this->
ctrl->redirect($this,
'userassignment');
834 foreach ($assigned_users_new as $user_id) {
836 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_anonymous_cannot_be_assigned'),
true);
839 $this->rbacadmin->assignUser($this->
object->getId(), $user_id,
false);
843 $this->
object->update();
845 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_userassignment_changed"),
true);
846 $this->
ctrl->redirect($this,
'userassignment');
851 if (!$this->
checkAccess(
'edit_userassignment',
'edit_permission')) {
852 $this->
ilias->raiseError(
853 $this->
lng->txt(
"msg_no_perm_assign_user_to_role"),
854 $this->
ilias->error_obj->MESSAGE
858 $selected_users = [];
859 if ($this->
http->wrapper()->query()->has(
'user_id')) {
861 $this->
http->wrapper()->query()->retrieve(
867 if ($this->
http->wrapper()->post()->has(
'user_id')) {
868 $selected_users = $this->
http->wrapper()->post()->retrieve(
870 $this->
refinery->kindlyTo()->listOf(
875 if (count($selected_users) === 0) {
876 $this->
ilias->raiseError($this->
lng->txt(
"no_checkbox"), $this->
ilias->error_obj->MESSAGE);
881 if ($admin = array_search(
SYSTEM_USER_ID, $selected_users) !==
false) {
882 unset($selected_users[$admin]);
888 $global_roles = $this->rbac_review->getGlobalRoles();
889 foreach ($selected_users as
$user) {
890 $assigned_roles = $this->rbac_review->assignedRoles($user);
891 $assigned_global_roles = array_intersect($assigned_roles, $global_roles);
893 if (count($assigned_roles) == 1 || count($assigned_global_roles) == 1 && in_array(
895 $assigned_global_roles
898 $last_role[
$user] = $userObj->getFullName();
904 foreach ($selected_users as $user) {
905 if (!isset($last_role[$user])) {
906 $this->rbacadmin->deassignUser($this->
object->getId(),
$user);
911 $this->
object->update();
914 if ($last_role !== []) {
915 $user_list = implode(
", ", $last_role);
916 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_is_last_role') .
': ' . $user_list .
'<br />' . $this->
lng->txt(
'msg_min_one_role'),
true);
918 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_userassignment_changed"),
true);
920 $this->
ctrl->redirect($this,
'userassignment');
930 $ilUser = $DIC[
'ilUser'];
932 if (!$this->
checkAccess(
'edit_userassignment',
'edit_permission')) {
933 $this->tpl->setOnScreenMessage(
934 $this->
lng->txt(
"msg_no_perm_assign_user_to_role"),
939 $this->tabs_gui->setTabActive(
'user_assignment');
941 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rbac_ua.html',
'Services/AccessControl');
947 || ($this->rbac_review->isAssigned($ilUser->getId(),
SYSTEM_ROLE_ID)
954 'auto_complete_name' => $this->
lng->txt(
'user'),
955 'submit_name' => $this->
lng->txt(
'add')
962 $this->ui_factory->link()->standard(
963 $this->
lng->txt(
'search_user'),
964 $this->
ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start')
971 $this->ui_factory->link()->standard(
972 $this->
lng->txt(
'role_mailto'),
973 $this->
ctrl->getLinkTarget($this,
'mailToRole')
976 $this->tpl->setVariable(
'BUTTONS_UA', $tb->getHTML());
978 $role_assignment_editable =
true;
982 $role_assignment_editable =
false;
990 $role_assignment_editable,
993 $this->tpl->setVariable(
'TABLE_UA', $ut->getHTML());
1002 if ($this->requested_new_type !=
'role') {
1003 $this->
ctrl->redirect($this,
'userassignment');
1005 $this->
ctrl->redirectByClass(
"ilobjrolefoldergui",
"view");
1014 if ($this->
getAdminMode() === self::ADMIN_MODE_SETTINGS) {
1015 parent::addAdminLocatorItems(
true);
1018 $this->
lng->txt(
'obj_' . $this->getParentType()),
1019 $this->
ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
'view')
1025 $this->
ctrl->getLinkTarget($this,
'perm')
1029 parent::addAdminLocatorItems($do_not_add_object);
1035 $base_role_container = $this->rbac_review->getFoldersAssignedToRole($this->
object->getId(),
true);
1036 $activate_role_edit =
false;
1041 in_array($this->obj_ref_id, $base_role_container) ||
1044 $activate_role_edit =
true;
1048 $this->tabs_gui->clearTargets();
1050 $this->
help->setScreenIdComponent(
"role");
1051 $this->tabs_gui->setBackTarget(
1052 $this->
lng->txt(
'btn_back'),
1053 (string) $this->
ctrl->getParentReturn($this)
1055 if ($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit) {
1056 $this->tabs_gui->addTarget(
1058 $this->
ctrl->getLinkTarget($this,
"edit"),
1064 $this->tabs_gui->addTarget(
1065 "default_perm_settings",
1066 $this->
ctrl->getLinkTarget($this,
"perm"),
1076 $this->tabs_gui->addTarget(
1078 $this->
ctrl->getLinkTarget($this,
"userassignment"),
1079 [
"deassignUser",
"userassignment",
"assignUser",
"searchUserForm",
"search"],
1088 $this->
lng->loadLanguageModule(
"rep");
1089 $this->tabs_gui->addTarget(
1090 "rep_recommended_content",
1091 $this->
ctrl->getLinkTargetByClass(
"ilrecommendedcontentroleconfiggui",
"")
1094 if ($this->
checkAccess(
'write',
'edit_permission')) {
1095 $this->tabs_gui->addTarget(
1097 $this->
ctrl->getLinkTargetByClass(
'ilExportGUI'),
1108 if (count($obj_ids) > 1) {
1109 $mail_roles[] =
'#il_role_' . $this->
object->getId();
1111 $mail_roles[] = (new \ilRoleMailboxAddress($this->
object->getId()))->value();
1118 public function checkAccess(
string $a_perm_global,
string $a_perm_obj =
''): bool
1120 $a_perm_obj = $a_perm_obj ?: $a_perm_global;
1123 return $this->rbac_system->checkAccess($a_perm_global, $this->obj_ref_id);
1125 return $this->
access->checkAccess($a_perm_obj,
'', $this->obj_ref_id);
1135 if ($this->rbac_review->isProtected($this->obj_ref_id, $this->object->getId())) {
1138 return count($this->rbac_review->getFoldersAssignedToRole($this->object->getId())) > 1;
1142 return count($this->rbac_review->getFoldersAssignedToRole($this->object->getId())) > 1;
1153 if ($this->
http->wrapper()->post()->has(
'protected')) {
1154 $protected = $this->
http->wrapper()->post()->retrieve(
1156 $this->
refinery->kindlyTo()->bool()
1160 $form->setFormAction($this->
ctrl->getFormAction($this,
'changeExistingObjects'));
1161 $form->setTitle($this->
lng->txt(
'rbac_change_existing_confirm_tbl'));
1163 $form->addCommandButton(
'changeExistingObjects', $this->
lng->txt(
'change_existing_objects'));
1164 $form->addCommandButton(
'perm', $this->
lng->txt(
'cancel'));
1167 $hidden->setValue($recursive ? json_encode([
'all']) : json_encode($recursive_list));
1168 $form->addItem($hidden);
1175 $this->
lng->txt(
'rbac_keep_local_policies'),
1177 $this->
lng->txt(
'rbac_keep_local_policies_info')
1182 $this->
lng->txt(
'rbac_keep_local_policies'),
1183 (string) ilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES,
1184 $this->
lng->txt(
'rbac_unprotected_keep_local_policies_info')
1187 $rad->addOption($keep);
1191 $this->
lng->txt(
'rbac_delete_local_policies'),
1193 $this->
lng->txt(
'rbac_delete_local_policies_info')
1197 $this->
lng->txt(
'rbac_delete_local_policies'),
1199 $this->
lng->txt(
'rbac_unprotected_delete_local_policies_info')
1202 $rad->addOption($del);
1204 $form->addItem($rad);
1205 $this->tpl->setContent($form->getHTML());
1211 if ($this->
http->wrapper()->post()->has(
'mode')) {
1212 $mode = $this->
http->wrapper()->post()->retrieve(
1220 if ($this->
http->wrapper()->post()->has(
'type_filter')) {
1221 $serialized_type_filter = $this->
http->wrapper()->post()->retrieve(
1223 $this->
refinery->kindlyTo()->string()
1225 $type_filter = json_decode(
1226 $serialized_type_filter,
1231 $this->
object->changeExistingObjects($start, $mode, $type_filter);
1232 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1233 $this->
ctrl->redirect($this,
'perm');
1239 case 'default_perm_settings':
1243 $this->tabs_gui->addSubTabTarget(
1244 'rbac_repository_permissions',
1245 $this->
ctrl->getLinkTarget($this,
'perm')
1247 $this->tabs_gui->addSubTabTarget(
1248 'rbac_admin_permissions',
1249 $this->
ctrl->getLinkTarget($this,
'adminPerm')
1260 if ($this->
http->wrapper()->post()->has(
'user_id')) {
1261 $users = $this->
http->wrapper()->post()->retrieve(
1263 $this->
refinery->kindlyTo()->listOf(
1268 if (count($users) === 0) {
1269 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1270 $this->
ctrl->redirect($this,
'userassignment');
1276 $this->
lng->loadLanguageModule(
'user');
1277 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
1278 $this->
ctrl->redirect($this,
'userassignment');
1287 $this->
ctrl->setParameterByClass(
1294 $this->
ctrl->getLinkTargetByClass(
1313 !$this->
object->getId() ||
1319 $possible_roles = [];
1321 $possible_roles = $this->rbac_review->getRolesOfObject(
1326 $this->
logger->warning(
'Role access check failed: ' . $e);
1327 throw new \ilObjectException($this->
lng->txt(
'permission_denied'));
1330 if (!in_array($this->
object->getId(), $possible_roles)) {
1332 throw new \ilObjectException($this->
lng->txt(
'permission_denied'));
Interface GlobalHttpState.
static get(string $a_var)
static isAutoGenerated(int $a_role_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An entity that renders components to a string output.
createObject()
Only called from administration -> role folder ? Otherwise this check access is wrong.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addToClipboardObject()
Add selected users to user clipboard.
__construct($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
adminPermObject()
Show administration permissions.
prepareOutput(bool $show_sub_objects=true)
readRoleProperties(ilObject $role, ilPropertyFormGUI $form)
Read role properties and write them to form.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
static newInstance(int $a_export_id)
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
addUserObject(array $a_user_ids)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setAllowRegister(bool $a_allow_register)
checkAccess(string $a_perm_global, string $a_perm_obj='')
adminPermSaveObject()
Save admin permissions.
static gatherTemplate(int $a_role_ref_id, int $a_role_id)
ensureRoleAccessForContext()
Ensure access to role for ref_id.
showChangeExistingObjectsConfirmation(bool $recursive, array $recursive_list)
Show confirmation screen.
cancelObject()
cancelObject is called when an operation is canceled, method links back public
parse()
Parse permissions.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
static _lookupObjId(int $ref_id)
permSaveObject(bool $a_show_admin_permissions=false)
save permissions public
permObject(bool $a_show_admin_permissions=false)
saveObject()
Save new role.
toggleAssignUsersStatus(bool $a_assign_users)
Export User Interface Class.
retrieveTemplatePermissionsFromPost()
loadRoleProperties(ilObjRole $role, ilPropertyFormGUI $form)
Store form input in role object.
static http()
Fetches the global http state from ILIAS.
static add(int $a_action, int $a_ref_id, array $a_diff, bool $a_source_ref_id=false)
static _lookupTitle(int $obj_id)
confirmDeleteRoleObject()
Show delete confirmation screen.
isChangeExistingObjectsConfirmationRequired()
Check if a confirmation about further settings is required or not.
getParentObjId()
Get obj_id of current object.
performDeleteRoleObject()
Delete role.
static _getTranslation(string $a_role_title)
Class ilObjectGUI Basic methods of all Output classes.
setValue(string $a_value)
getParentType()
get type of current object (not role folder)
header include for all ilias files.
showDefaultPermissionSettings()
check if default permissions are shown or not
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
static _getIdsForTitle(string $title, string $type='', bool $partial_match=false)
static _sortIds(array $a_ids, string $a_table, string $a_field, string $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
static redirect(string $a_script)
getParentRefId()
Get ref id of current object (not role folder id)
changeExistingObjectsObject()
initFormRoleProperties(int $a_mode)
userassignmentObject()
display user assignment panel
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
addAdminLocatorItems(bool $do_not_add_object=false)
This class represents a text area property in a property form.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
static diffTemplate(array $a_old, array $a_new)
TableGUI class for role administration.
Class ilRbacAdmin Core functions for role based access control.
getAdminTabs()
admin and normal tabs are equal for roles
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupType(int $id, bool $reference=false)
static allocateExportId()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addMultiCommand(string $a_cmd, string $a_text)
updateObject()
Save role settings.
static _getInstance()
Get instance of ilSecuritySettings.
static set(string $a_var, $a_val)
Set a value.
setDescription(string $description)
getContainerType()
Get type of role container.
static getInstance(int $a_usr_id)
getPresentationTitle()
get presentation title Normally same as title Overwritten for sessions