19 declare(strict_types=1);
53 bool $a_call_by_reference =
false,
54 bool $a_prepare_output =
true 58 $this->rbacadmin = $DIC->rbac()->admin();
59 $this->
help = $DIC->help();
60 $this->
logger = $DIC->logger()->ac();
62 $this->role_id = $a_id;
63 $this->
http = $DIC->http();
74 $this->
ctrl->saveParameter($this, [
'obj_id',
'rolf_ref_id']);
75 $this->
lng->loadLanguageModule(
'rbac');
82 $next_class = $this->
ctrl->getNextClass($this);
83 $cmd = $this->
ctrl->getCmd();
87 switch ($next_class) {
88 case 'ilrepositorysearchgui':
91 $GLOBALS[
'DIC'][
'ilErr']->raiseError(
92 $GLOBALS[
'DIC'][
'lng']->txt(
'permission_denied'),
97 $rep_search->setTitle($this->
lng->txt(
'role_add_user'));
98 $rep_search->setCallback($this,
'addUserObject');
101 $this->tabs_gui->setTabActive(
'user_assignment');
102 $this->
ctrl->setReturn($this,
'userassignment');
103 $ret = $this->
ctrl->forwardCommand($rep_search);
108 $this->tabs_gui->setTabActive(
'export');
114 $exp->addFormat(
'xml');
115 $this->
ctrl->forwardCommand($exp);
118 case 'ilrecommendedcontentroleconfiggui':
119 $this->tabs_gui->setTabActive(
'rep_recommended_content');
121 $this->
ctrl->forwardCommand($ui);
129 $cmd =
'userassignment';
146 $this->obj_ref_id = 0;
148 if ($this->
http->wrapper()->query()->has(
'rolf_ref_id')) {
149 $this->obj_ref_id = $this->
http->wrapper()->query()->retrieve(
153 } elseif ($this->
http->wrapper()->query()->has(
'ref_id')) {
154 $this->obj_ref_id = $this->
http->wrapper()->query()->retrieve(
163 $template_permissions = [];
164 if ($this->
http->wrapper()->post()->has(
'template_perm')) {
165 $custom_transformer = $this->
refinery->custom()->transformation(
170 $template_permissions = $this->
http->wrapper()->post()->retrieve(
175 return $template_permissions;
224 || $this->obj_definition->isAdministrationObject($this->
getContainerType());
231 if ($this->creation_mode) {
232 $this->
ctrl->setParameter($this,
"new_type",
'role');
234 $form->setFormAction($this->
ctrl->getFormAction($this));
237 case self::MODE_GLOBAL_CREATE:
238 $form->setTitle($this->
lng->txt(
'role_new'));
239 $form->addCommandButton(
'save', $this->
lng->txt(
'role_new'));
242 case self::MODE_GLOBAL_UPDATE:
243 $form->setTitle($this->
lng->txt(
'role_edit'));
244 $form->addCommandButton(
'update', $this->
lng->txt(
'save'));
247 case self::MODE_LOCAL_CREATE:
248 case self::MODE_LOCAL_UPDATE:
251 $form->addCommandButton(
'cancel', $this->
lng->txt(
'cancel'));
255 $title->setDisabled(
true);
258 $title->setValidationRegexp(
'/^(?!il_).*$/');
259 $title->setValidationFailureMessage($this->
lng->txt(
'msg_role_reserved_prefix'));
263 $title->setMaxLength(70);
264 $title->setRequired(
true);
265 $form->addItem($title);
273 $form->addItem($desc);
275 if ($a_mode != self::MODE_LOCAL_CREATE && $a_mode != self::MODE_GLOBAL_CREATE) {
277 $form->addItem($ilias_id);
283 #$reg->setInfo($this->lng->txt('rbac_new_acc_reg_info')); 284 $form->addItem($reg);
288 #$la->setInfo($this->lng->txt('rbac_local_admin_info')); 294 #$pro->setInfo($this->lng->txt('role_protext_permission_info')); 295 $form->addItem($pro);
323 $rbacreview = $DIC[
'rbacreview'];
328 $data[
'reg'] = $role->getAllowRegister();
329 $data[
'la'] = $role->getAssignUsersStatus();
330 $data[
'pro'] = $rbacreview->isProtected($this->obj_ref_id, $role->
getId());
341 if (!$this->rbac_system->checkAccess(
'create_role', $this->obj_ref_id)) {
342 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
343 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
346 $this->tpl->setContent($form->getHTML());
351 if (!$this->
checkAccess(
'write',
'edit_permission')) {
352 $this->tpl->setOnScreenMessage(
'msg_no_perm_write', $this->
lng->txt(
'permission_denied'),
true);
353 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
355 $this->tabs_gui->activateTab(
'edit_properties');
359 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
360 if ($this->rbac_review->isDeleteable($this->object->getId(),
$this->obj_ref_id)) {
362 $this->
lng->txt(
'rbac_delete_role'),
363 $this->
ctrl->getLinkTarget($this,
'confirmDeleteRole')
369 $this->tpl->setContent($form->getHTML());
379 if ($form->checkInput()) {
384 $this->rbacadmin->setProtected(
387 $form->getInput(
'pro') ?
'y' :
'n' 389 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"role_added"),
true);
390 $this->
ctrl->setParameter($this,
'obj_id', $role->getId());
391 $this->
ctrl->redirect($this,
'perm');
394 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
395 $form->setValuesByPost();
396 $this->tpl->setContent($form->getHTML());
406 if ($form->checkInput()) {
408 $this->
object->update();
409 $this->rbacadmin->setProtected(
412 $form->getInput(
'pro') ?
'y' :
'n' 414 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"saved_successfully"),
true);
415 $this->
ctrl->redirect($this,
'edit');
418 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
419 $form->setValuesByPost();
420 $this->tpl->setContent($form->getHTML());
423 protected function permObject(
bool $a_show_admin_permissions =
false): void
425 $this->tabs_gui->setTabActive(
'default_perm_settings');
429 if ($a_show_admin_permissions) {
430 $this->tabs_gui->setSubTabActive(
'rbac_admin_permissions');
432 $this->tabs_gui->setSubTabActive(
'rbac_repository_permissions');
435 if (!$this->
checkAccess(
'write',
'edit_permission')) {
436 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'),
true);
437 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
442 $this->
toolbar->setFormAction($this->
ctrl->getFormAction($this));
444 $this->
lng->txt(
"adopt_perm_from_template"),
445 $this->
ctrl->getLinkTarget($this,
'adoptPerm')
447 if ($this->rbac_review->isDeleteable($this->object->getId(),
$this->obj_ref_id)) {
449 $this->
lng->txt(
'rbac_delete_role'),
450 $this->
ctrl->getLinkTarget($this,
'confirmDeleteRole')
455 $this->tpl->addBlockFile(
458 'tpl.rbac_template_permissions.html',
459 'Services/AccessControl' 462 $this->tpl->setVariable(
'PERM_ACTION', $this->
ctrl->getFormAction($this));
469 if ($a_show_admin_permissions) {
470 $subs = ilObjRole::getSubObjects(
'adm',
true);
472 $subs = ilObjRole::getSubObjects(
'root',
false);
475 $subs = ilObjRole::getSubObjects($this->
getParentType(), $a_show_admin_permissions);
478 foreach ($subs as $subtype => $def) {
485 $a_show_admin_permissions
489 $acc->addItem($def[
'translation'], $tbl->getHTML());
492 $this->tpl->setVariable(
'ACCORDION', $acc->getHTML());
500 $a_show_admin_permissions
504 $a_show_admin_permissions ?
'adminPermSave' :
'permSave',
505 $this->
lng->txt(
'save')
510 $this->tpl->setVariable(
'OPTIONS_TABLE', $options->getHTML());
533 $parent_role_ids = $this->rbac_review->getParentRoleIds($this->obj_ref_id,
true);
535 $this->tabs_gui->clearTargets();
538 foreach (array_keys($parent_role_ids) as
$id) {
542 $sorted_ids =
ilUtil::_sortIds($ids,
'object_data',
'type,title',
'obj_id');
544 foreach ($sorted_ids as $id) {
545 $par = $parent_role_ids[
$id];
547 $output[
$key][
"role_id"] = $par[
"obj_id"];
548 $output[
$key][
"type"] = ($par[
"type"] ==
'role' ? $this->
lng->txt(
'obj_role') : $this->
lng->txt(
'obj_rolt'));
550 $output[
$key][
"role_desc"] = $par[
"desc"];
556 $tbl->setTitle($this->
lng->txt(
"adopt_perm_from_template"));
557 $tbl->setData($output);
559 $this->tpl->setContent($tbl->getHTML());
567 $this->tabs_gui->clearTargets();
569 if (!$this->
checkAccess(
'visible,write',
'edit_permission')) {
570 $this->tpl->setOnScreenMessage(
'msg_no_perm_perm', $this->
lng->txt(
'permission_denied'),
true);
571 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
574 $question = $this->
lng->txt(
'rbac_role_delete_qst');
575 if ($this->rbac_review->isAssigned($this->user->getId(), $this->
object->getId())) {
576 $question .= (
'<br />' . $this->
lng->txt(
'rbac_role_delete_self'));
578 $this->tpl->setOnScreenMessage(
'question', $question);
581 $confirm->setFormAction($this->
ctrl->getFormAction($this));
582 $confirm->setHeaderText($question);
583 $confirm->setCancel($this->
lng->txt(
'cancel'),
'perm');
584 $confirm->setConfirm($this->
lng->txt(
'rbac_delete_role'),
'performDeleteRole');
588 (
string) $this->
object->getId(),
593 $this->tpl->setContent($confirm->getHTML());
601 if (!$this->
checkAccess(
'visible,write',
'edit_permission')) {
602 $this->tpl->setOnScreenMessage(
'msg_no_perm_perm', $this->
lng->txt(
'permission_denied'),
true);
603 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
606 $this->
object->setParent($this->obj_ref_id);
607 $this->
object->delete();
608 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_deleted_role'),
true);
610 $this->
ctrl->returnToParent($this);
619 if (!$this->
checkAccess(
'visible,write',
'edit_permission')) {
620 $this->tpl->setOnScreenMessage(
'msg_no_perm_perm', $this->
lng->txt(
'permission_denied'),
true);
621 $this->
ctrl->redirectByClass(ilRepositoryGUI::class);
626 if ($rbac_log_active) {
632 if ($a_show_admin_permissions) {
633 $subs = ilObjRole::getSubObjects(
'adm',
true);
635 $subs = ilObjRole::getSubObjects(
'root',
false);
638 $subs = ilObjRole::getSubObjects($this->
getParentType(), $a_show_admin_permissions);
641 foreach (array_keys($subs) as $subtype) {
647 foreach ($template_permissions as
$key => $ops_array) {
652 if ($rbac_log_active) {
659 $this->
object->update();
663 if ($this->
http->wrapper()->post()->has(
'protected')) {
664 $protected = $this->
http->wrapper()->post()->retrieve(
672 $this->rbacadmin->setProtected($this->obj_ref_id, $this->
object->getId(),
ilUtil::tf2yn($protected));
675 if ($this->
http->wrapper()->post()->has(
'recursive')) {
676 $recursive = $this->
http->wrapper()->post()->retrieve(
682 $recursive_list = [];
683 if ($this->
http->wrapper()->post()->has(
'recursive_list')) {
684 $recursive_list = $this->
http->wrapper()->post()->retrieve(
686 $this->
refinery->kindlyTo()->listOf(
687 $this->
refinery->kindlyTo()->string()
691 if ($a_show_admin_permissions) {
696 if (!$recursive && !count($recursive_list)) {
697 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"saved_successfully"),
true);
698 if ($a_show_admin_permissions) {
699 $this->
ctrl->redirect($this,
'adminPerm');
701 $this->
ctrl->redirect($this,
'perm');
706 ($recursive || count($recursive_list)) &&
708 !$a_show_admin_permissions
715 if ($a_show_admin_permissions) {
716 $start = $this->tree->getParentId($this->obj_ref_id);
720 $this->
object->changeExistingObjects(
727 $this->
object->changeExistingObjects(
734 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"saved_successfully"),
true);
736 if ($a_show_admin_permissions) {
737 $this->
ctrl->redirect($this,
'adminPerm');
739 $this->
ctrl->redirect($this,
'perm');
746 if ($this->
http->wrapper()->post()->has(
'adopt')) {
747 $source = $this->
http->wrapper()->post()->retrieve(
754 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
761 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
764 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_perm_adopted_from_itself"),
true);
767 $parentRoles = $this->rbac_review->getParentRoleIds($this->obj_ref_id,
true);
768 $this->rbacadmin->copyRoleTemplatePermissions(
770 $parentRoles[
$source][
"parent"],
777 $this->
object->update();
781 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_perm_adopted_from1") .
" '" .
783 $this->
lng->txt(
"msg_perm_adopted_from2"),
true);
786 $this->
ctrl->redirect($this,
"perm");
794 if (!$this->
checkAccess(
'edit_userassignment',
'edit_permission')) {
795 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_assign_user_to_role'),
true);
798 if (!$this->rbac_review->isAssignable($this->object->getId(),
$this->obj_ref_id) &&
800 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_role_not_assignable'),
true);
803 if ($a_user_ids === []) {
804 $GLOBALS[
'DIC'][
'lng']->loadLanguageModule(
'search');
805 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'search_err_user_not_exist'),
true);
809 $assigned_users_all = $this->rbac_review->assignedUsers($this->
object->getId());
812 $assigned_users_new = array_diff($a_user_ids, array_intersect($a_user_ids, $assigned_users_all));
815 if (count($assigned_users_new) == 0) {
816 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"rbac_msg_user_already_assigned"),
true);
817 $this->
ctrl->redirect($this,
'userassignment');
821 foreach ($assigned_users_new as $user_id) {
823 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_anonymous_cannot_be_assigned'),
true);
826 $this->rbacadmin->assignUser($this->
object->getId(), $user_id,
false);
830 $this->
object->update();
832 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_userassignment_changed"),
true);
833 $this->
ctrl->redirect($this,
'userassignment');
838 if (!$this->
checkAccess(
'edit_userassignment',
'edit_permission')) {
839 $this->
ilias->raiseError(
840 $this->
lng->txt(
"msg_no_perm_assign_user_to_role"),
841 $this->
ilias->error_obj->MESSAGE
845 $selected_users = [];
846 if ($this->
http->wrapper()->query()->has(
'user_id')) {
848 $this->
http->wrapper()->query()->retrieve(
854 if ($this->
http->wrapper()->post()->has(
'user_id')) {
855 $selected_users = $this->
http->wrapper()->post()->retrieve(
857 $this->
refinery->kindlyTo()->listOf(
862 if (count($selected_users) === 0) {
863 $this->
ilias->raiseError($this->
lng->txt(
"no_checkbox"), $this->
ilias->error_obj->MESSAGE);
868 if ($admin = array_search(
SYSTEM_USER_ID, $selected_users) !==
false) {
869 unset($selected_users[$admin]);
875 $global_roles = $this->rbac_review->getGlobalRoles();
876 foreach ($selected_users as
$user) {
877 $assigned_roles = $this->rbac_review->assignedRoles($user);
878 $assigned_global_roles = array_intersect($assigned_roles, $global_roles);
880 if (count($assigned_roles) == 1 || count($assigned_global_roles) == 1 && in_array(
882 $assigned_global_roles
885 $last_role[
$user] = $userObj->getFullName();
891 foreach ($selected_users as $user) {
892 if (!isset($last_role[$user])) {
893 $this->rbacadmin->deassignUser($this->
object->getId(),
$user);
898 $this->
object->update();
901 if ($last_role !== []) {
902 $user_list = implode(
", ", $last_role);
903 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_is_last_role') .
': ' . $user_list .
'<br />' . $this->
lng->txt(
'msg_min_one_role'),
true);
905 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_userassignment_changed"),
true);
907 $this->
ctrl->redirect($this,
'userassignment');
919 if (!$this->
checkAccess(
'edit_userassignment',
'edit_permission')) {
920 $this->
ilias->raiseError(
921 $this->
lng->txt(
"msg_no_perm_assign_user_to_role"),
922 $this->
ilias->error_obj->MESSAGE
926 $this->tabs_gui->setTabActive(
'user_assignment');
928 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.rbac_ua.html',
'Services/AccessControl');
947 'auto_complete_name' => $this->
lng->txt(
'user'),
948 'submit_name' => $this->
lng->txt(
'add')
955 $this->
lng->txt(
'search_user'),
956 $this->
ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start')
962 $this->
lng->txt(
'role_mailto'),
963 $this->
ctrl->getLinkTarget($this,
'mailToRole')
965 $this->tpl->setVariable(
'BUTTONS_UA', $tb->getHTML());
967 $role_assignment_editable =
true;
971 $role_assignment_editable =
false;
977 $role_assignment_editable,
980 $this->tpl->setVariable(
'TABLE_UA', $ut->getHTML());
989 if ($this->requested_new_type !=
'role') {
990 $this->
ctrl->redirect($this,
'userassignment');
992 $this->
ctrl->redirectByClass(
"ilobjrolefoldergui",
"view");
1001 if ($this->
getAdminMode() === self::ADMIN_MODE_SETTINGS) {
1002 parent::addAdminLocatorItems(
true);
1005 $this->
lng->txt(
'obj_' . $this->getParentType()),
1006 $this->
ctrl->getLinkTargetByClass(
"ilobjrolefoldergui",
'view')
1012 $this->
ctrl->getLinkTarget($this,
'perm')
1016 parent::addAdminLocatorItems($do_not_add_object);
1022 $base_role_container = $this->rbac_review->getFoldersAssignedToRole($this->
object->getId(),
true);
1023 $activate_role_edit =
false;
1028 in_array($this->obj_ref_id, $base_role_container) ||
1031 $activate_role_edit =
true;
1035 $this->tabs_gui->clearTargets();
1037 $this->
help->setScreenIdComponent(
"role");
1038 $this->tabs_gui->setBackTarget(
1039 $this->
lng->txt(
'btn_back'),
1040 (string) $this->
ctrl->getParentReturn($this)
1042 if ($this->
checkAccess(
'write',
'edit_permission') && $activate_role_edit) {
1043 $this->tabs_gui->addTarget(
1045 $this->
ctrl->getLinkTarget($this,
"edit"),
1051 $this->tabs_gui->addTarget(
1052 "default_perm_settings",
1053 $this->
ctrl->getLinkTarget($this,
"perm"),
1063 $this->tabs_gui->addTarget(
1065 $this->
ctrl->getLinkTarget($this,
"userassignment"),
1066 [
"deassignUser",
"userassignment",
"assignUser",
"searchUserForm",
"search"],
1075 $this->
lng->loadLanguageModule(
"rep");
1076 $this->tabs_gui->addTarget(
1077 "rep_recommended_content",
1078 $this->
ctrl->getLinkTargetByClass(
"ilrecommendedcontentroleconfiggui",
"")
1081 if ($this->
checkAccess(
'write',
'edit_permission')) {
1082 $this->tabs_gui->addTarget(
1084 $this->
ctrl->getLinkTargetByClass(
'ilExportGUI'),
1095 if (count($obj_ids) > 1) {
1096 $mail_roles[] =
'#il_role_' . $this->
object->getId();
1098 $mail_roles[] = (new \ilRoleMailboxAddress($this->
object->getId()))->value();
1105 public function checkAccess(
string $a_perm_global,
string $a_perm_obj =
''): bool
1107 $a_perm_obj = $a_perm_obj ?: $a_perm_global;
1110 return $this->rbac_system->checkAccess($a_perm_global, $this->obj_ref_id);
1112 return $this->
access->checkAccess($a_perm_obj,
'', $this->obj_ref_id);
1122 if ($this->rbac_review->isProtected($this->obj_ref_id, $this->object->getId())) {
1125 return count($this->rbac_review->getFoldersAssignedToRole($this->object->getId())) > 1;
1129 return count($this->rbac_review->getFoldersAssignedToRole($this->object->getId())) > 1;
1140 if ($this->
http->wrapper()->post()->has(
'protected')) {
1141 $protected = $this->
http->wrapper()->post()->retrieve(
1143 $this->
refinery->kindlyTo()->bool()
1147 $form->setFormAction($this->
ctrl->getFormAction($this,
'changeExistingObjects'));
1148 $form->setTitle($this->
lng->txt(
'rbac_change_existing_confirm_tbl'));
1150 $form->addCommandButton(
'changeExistingObjects', $this->
lng->txt(
'change_existing_objects'));
1151 $form->addCommandButton(
'perm', $this->
lng->txt(
'cancel'));
1154 $hidden->setValue($recursive ? json_encode([
'all']) : json_encode($recursive_list));
1155 $form->addItem($hidden);
1162 $this->
lng->txt(
'rbac_keep_local_policies'),
1164 $this->
lng->txt(
'rbac_keep_local_policies_info')
1169 $this->
lng->txt(
'rbac_keep_local_policies'),
1170 (string) ilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES,
1171 $this->
lng->txt(
'rbac_unprotected_keep_local_policies_info')
1174 $rad->addOption($keep);
1178 $this->
lng->txt(
'rbac_delete_local_policies'),
1180 $this->
lng->txt(
'rbac_delete_local_policies_info')
1184 $this->
lng->txt(
'rbac_delete_local_policies'),
1186 $this->
lng->txt(
'rbac_unprotected_delete_local_policies_info')
1189 $rad->addOption($del);
1191 $form->addItem($rad);
1192 $this->tpl->setContent($form->getHTML());
1198 if ($this->
http->wrapper()->post()->has(
'mode')) {
1199 $mode = $this->
http->wrapper()->post()->retrieve(
1207 if ($this->
http->wrapper()->post()->has(
'type_filter')) {
1208 $serialized_type_filter = $this->
http->wrapper()->post()->retrieve(
1210 $this->
refinery->kindlyTo()->string()
1212 $type_filter = json_decode(
1213 $serialized_type_filter,
1218 $this->
object->changeExistingObjects($start, $mode, $type_filter);
1219 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1220 $this->
ctrl->redirect($this,
'perm');
1226 case 'default_perm_settings':
1230 $this->tabs_gui->addSubTabTarget(
1231 'rbac_repository_permissions',
1232 $this->
ctrl->getLinkTarget($this,
'perm')
1234 $this->tabs_gui->addSubTabTarget(
1235 'rbac_admin_permissions',
1236 $this->
ctrl->getLinkTarget($this,
'adminPerm')
1247 if ($this->
http->wrapper()->post()->has(
'user_id')) {
1248 $users = $this->
http->wrapper()->post()->retrieve(
1250 $this->
refinery->kindlyTo()->listOf(
1255 if (count($users) === 0) {
1256 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1257 $this->
ctrl->redirect($this,
'userassignment');
1263 $this->
lng->loadLanguageModule(
'user');
1264 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
1265 $this->
ctrl->redirect($this,
'userassignment');
1274 $this->
ctrl->setParameterByClass(
1281 $this->
ctrl->getLinkTargetByClass(
1300 !$this->
object->getId() ||
1306 $possible_roles = [];
1308 $possible_roles = $this->rbac_review->getRolesOfObject(
1313 $this->
logger->warning(
'Role access check failed: ' . $e);
1314 throw new \ilObjectException($this->
lng->txt(
'permission_denied'));
1317 if (!in_array($this->
object->getId(), $possible_roles)) {
1319 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...
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.
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)
setDescription(string $desc)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
__construct( $a_data, int $a_id, bool $a_call_by_reference=false, bool $a_prepare_output=true)
getParentType()
get type of current object (not role folder)
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
addAdminLocatorItems(bool $do_not_add_object=false)
__construct(Container $dic, ilPlugin $plugin)
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.
getContainerType()
Get type of role container.
static getInstance(int $a_usr_id)
getPresentationTitle()
get presentation title Normally same as title Overwritten for sessions
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...