ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilObjRoleGUI Class Reference

Class ilObjRoleGUI. More...

+ Inheritance diagram for ilObjRoleGUI:
+ Collaboration diagram for ilObjRoleGUI:

Public Member Functions

 executeCommand ()
 
 getParentRefId ()
 Get ref id of current object (not role folder id) More...
 
 getParentObjId ()
 Get obj_id of current object. More...
 
 getParentType ()
 get type of current object (not role folder) More...
 
 getAdminTabs ()
 admin and normal tabs are equal for roles More...
 
 createObject ()
 create new object form More...
 
 editObject ()
 
 saveObject ()
 Save new role. More...
 
 updateObject ()
 Save role settings. More...
 
 permSaveObject (bool $a_show_admin_permissions=false)
 save permissions @access public More...
 
 adoptPermSaveObject ()
 
 addUserObject (array $a_user_ids)
 
 deassignUserObject ()
 
 userassignmentObject ()
 display user assignment panel More...
 
 mailToRoleObject ()
 
 checkAccess (string $a_perm_global, string $a_perm_obj='')
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Member Functions

 getRoleId ()
 
 initParentRefId ()
 
 retrieveTemplatePermissionsFromPost ()
 
 getContainerType ()
 Get type of role container. More...
 
 showDefaultPermissionSettings ()
 check if default permissions are shown or not More...
 
 getRoleForm (bool $is_role_creation_form=false)
 
 permObject (bool $a_show_admin_permissions=false)
 
 adminPermObject ()
 
 adminPermSaveObject ()
 
 adoptPermObject ()
 
 confirmDeleteRoleObject ()
 Show delete confirmation screen. More...
 
 performDeleteRoleObject ()
 Delete role. More...
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 isChangeExistingObjectsConfirmationRequired ()
 Check if a confirmation about further settings is required or not. More...
 
 showChangeExistingObjectsConfirmation (bool $recursive, array $recursive_list)
 Show confirmation screen. More...
 
 changeExistingObjectsObject ()
 
 setSubTabs ($a_tab)
 
 addToClipboardObject ()
 Add selected users to user clipboard. More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 ensureRoleAccessForContext ()
 Ensure access to role for ref_id. More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Protected Attributes

int $obj_ref_id = 0
 
int $obj_obj_id = 0
 
string $obj_obj_type = ''
 
string $container_type = ''
 
int $role_id = 0
 
ilHelpGUI $help
 
Factory $refinery
 
UIFactory $ui_factory
 
Renderer $ui_renderer
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
CustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 buildEditPage (?StandardForm $form=null)
 
 buildConfirmationModal ()
 

Private Attributes

const FORM_KEY_TITLE = 'title'
 
const FORM_KEY_DESCRIPTION = 'description'
 
const FORM_KEY_ILIAS_ID = 'ilias_id'
 
const FORM_KEY_ON_REGISTRATION_FORM = 'on_registration_form'
 
const FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT = 'allow_local_user_assignment'
 
const FORM_KEY_PROTECT = 'protect'
 
ilLogger $logger
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 
- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 

Detailed Description

Class ilObjRoleGUI.

Author
Stefan Meyer <smeyer@ilias@gmx.de>
Sascha Hofmann sasch.nosp@m.ahof.nosp@m.mann@.nosp@m.gmx..nosp@m.de
Version
$Id$ @ilCtrl_Calls ilObjRoleGUI: ilRepositorySearchGUI, ilExportGUI, ilRecommendedContentRoleConfigGUI

Definition at line 35 of file class.ilObjRoleGUI.php.

Member Function Documentation

◆ addAdminLocatorItems()

ilObjRoleGUI::addAdminLocatorItems ( bool  $do_not_add_object = false)
protected

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 992 of file class.ilObjRoleGUI.php.

992 : void
993 {
994 if ($this->getAdminMode() === self::ADMIN_MODE_SETTINGS) {
995 parent::addAdminLocatorItems(true);
996
997 $this->locator->addItem(
998 $this->lng->txt('obj_' . $this->getParentType()),
999 $this->ctrl->getLinkTargetByClass("ilobjrolefoldergui", 'view')
1000 );
1001
1002 if ($this->object instanceof ilObjRole) {
1003 $this->locator->addItem(
1004 ilObjRole::_getTranslation($this->object->getTitle()),
1005 $this->ctrl->getLinkTarget($this, 'perm')
1006 );
1007 }
1008 } else {
1009 parent::addAdminLocatorItems($do_not_add_object);
1010 }
1011 }
Class ilObjRole.
static _getTranslation(string $a_role_title)

References ilObjRole\_getTranslation(), ilObjectGUI\getAdminMode(), ILIAS\Repository\lng(), ILIAS\Repository\locator(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjRoleGUI::addLocatorItems ( )
protected

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

Definition at line 1264 of file class.ilObjRoleGUI.php.

1264 : void
1265 {
1266 if ($this->getAdminMode() === self::ADMIN_MODE_NONE || $this->getAdminMode() === self::ADMIN_MODE_REPOSITORY) {
1267 $this->ctrl->setParameterByClass(
1268 "ilobjrolegui",
1269 "obj_id",
1270 $this->getRoleId()
1271 );
1272 $this->locator->addItem(
1273 ilObjRole::_getTranslation($this->object->getTitle()),
1274 $this->ctrl->getLinkTargetByClass(
1275 [
1276 "ilpermissiongui",
1277 "ilobjrolegui"
1278 ],
1279 "perm"
1280 )
1281 );
1282 }
1283 }

References ilObjRole\_getTranslation(), ILIAS\Repository\ctrl(), ilObjectGUI\getAdminMode(), getRoleId(), ILIAS\Repository\locator(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ addToClipboardObject()

ilObjRoleGUI::addToClipboardObject ( )
protected

Add selected users to user clipboard.

Definition at line 1237 of file class.ilObjRoleGUI.php.

1237 : void
1238 {
1239 $users = [];
1240 if ($this->http->wrapper()->post()->has('user_id')) {
1241 $users = $this->http->wrapper()->post()->retrieve(
1242 'user_id',
1243 $this->refinery->kindlyTo()->listOf(
1244 $this->refinery->kindlyTo()->int()
1245 )
1246 );
1247 }
1248 if (count($users) === 0) {
1249 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1250 $this->ctrl->redirect($this, 'userassignment');
1251 }
1252 $clip = ilUserClipboard::getInstance($this->user->getId());
1253 $clip->add($users);
1254 $clip->save();
1255
1256 $this->lng->loadLanguageModule('user');
1257 $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
1258 $this->ctrl->redirect($this, 'userassignment');
1259 }
static getInstance(int $a_usr_id)
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\ctrl(), ilUserClipboard\getInstance(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ addUserObject()

ilObjRoleGUI::addUserObject ( array  $a_user_ids)
Parameters
int[]

Definition at line 802 of file class.ilObjRoleGUI.php.

802 : void
803 {
804 if (!$this->checkAccess('edit_userassignment', 'edit_permission')) {
805 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_assign_user_to_role'), true);
806 return;
807 }
808 if (!$this->rbac_review->isAssignable($this->object->getId(), $this->obj_ref_id) &&
809 $this->obj_ref_id != ROLE_FOLDER_ID) {
810 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('err_role_not_assignable'), true);
811 return;
812 }
813 if ($a_user_ids === []) {
814 $this->lng->loadLanguageModule('search');
815 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('search_err_user_not_exist'), true);
816 return;
817 }
818
819 $assigned_users_all = $this->rbac_review->assignedUsers($this->object->getId());
820
821 // users to assign
822 $assigned_users_new = array_diff($a_user_ids, array_intersect($a_user_ids, $assigned_users_all));
823
824 // selected users all already assigned. stop
825 if (count($assigned_users_new) == 0) {
826 $this->tpl->setOnScreenMessage('info', $this->lng->txt("rbac_msg_user_already_assigned"), true);
827 $this->ctrl->redirect($this, 'userassignment');
828 }
829
830 // assign new users
831 foreach ($assigned_users_new as $user_id) {
832 if ($user_id === ANONYMOUS_USER_ID) {
833 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_anonymous_cannot_be_assigned'), true);
834 return;
835 }
836 $this->rbac_admin->assignUser($this->object->getId(), $user_id, false);
837 }
838
839 // update object data entry (to update last modification date)
840 $this->object->update();
841
842 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_userassignment_changed"), true);
843 $this->ctrl->redirect($this, 'userassignment');
844 }
checkAccess(string $a_perm_global, string $a_perm_obj='')
const ANONYMOUS_USER_ID
Definition: constants.php:27
const ROLE_FOLDER_ID
Definition: constants.php:34

References $user_id, ANONYMOUS_USER_ID, checkAccess(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ROLE_FOLDER_ID.

+ Here is the call graph for this function:

◆ adminPermObject()

ilObjRoleGUI::adminPermObject ( )
protected

Definition at line 530 of file class.ilObjRoleGUI.php.

530 : void
531 {
532 $this->permObject(true);
533 }
permObject(bool $a_show_admin_permissions=false)

References permObject().

+ Here is the call graph for this function:

◆ adminPermSaveObject()

ilObjRoleGUI::adminPermSaveObject ( )
protected

Definition at line 535 of file class.ilObjRoleGUI.php.

535 : void
536 {
537 $this->permSaveObject(true);
538 }
permSaveObject(bool $a_show_admin_permissions=false)
save permissions @access public

References permSaveObject().

+ Here is the call graph for this function:

◆ adoptPermObject()

ilObjRoleGUI::adoptPermObject ( )
protected

Definition at line 540 of file class.ilObjRoleGUI.php.

540 : void
541 {
542 $output = [];
543 $parent_role_ids = $this->rbac_review->getParentRoleIds($this->obj_ref_id, true);
544
545 $this->tabs_gui->clearTargets();
546
547 $ids = [];
548 foreach (array_keys($parent_role_ids) as $id) {
549 $ids[] = $id;
550 }
551 // Sort ids
552 $sorted_ids = ilUtil::_sortIds($ids, 'object_data', 'type,title', 'obj_id');
553 $key = 0;
554 foreach ($sorted_ids as $id) {
555 $par = $parent_role_ids[$id];
556 if ($par["obj_id"] != SYSTEM_ROLE_ID && $this->object->getId() != $par["obj_id"]) {
557 $output[$key]["role_id"] = $par["obj_id"];
558 $output[$key]["type"] = ($par["type"] == 'role' ? $this->lng->txt('obj_role') : $this->lng->txt('obj_rolt'));
559 $output[$key]["role_name"] = ilObjRole::_getTranslation($par["title"]);
560 $output[$key]["role_desc"] = $par["desc"];
561 $key++;
562 }
563 }
564
565 $tbl = new ilRoleAdoptPermissionTableGUI($this, "adoptPerm");
566 $tbl->setTitle($this->lng->txt("adopt_perm_from_template"));
567 $tbl->setData($output);
568
569 $this->tpl->setContent($tbl->getHTML());
570 }
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,...
const SYSTEM_ROLE_ID
Definition: constants.php:29

References ilObjectGUI\$id, ilObjRole\_getTranslation(), ilUtil\_sortIds(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and SYSTEM_ROLE_ID.

Referenced by adoptPermSaveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ adoptPermSaveObject()

ilObjRoleGUI::adoptPermSaveObject ( )

Definition at line 753 of file class.ilObjRoleGUI.php.

753 : void
754 {
755 $source = 0;
756 if ($this->http->wrapper()->post()->has('adopt')) {
757 $source = $this->http->wrapper()->post()->retrieve(
758 'adopt',
759 $this->refinery->kindlyTo()->int()
760 );
761 }
762
763 if (!$source) {
764 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'));
765 $this->adoptPermObject();
766 return;
767 }
768
769 $access = $this->checkAccess('visible,write', 'edit_permission');
770 if (!$access) {
771 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_perm'), true);
772 }
773 if ($this->object->getId() == $source) {
774 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_perm_adopted_from_itself"), true);
775 } else {
776 $this->rbac_admin->deleteRolePermission($this->object->getId(), $this->obj_ref_id);
777 $parentRoles = $this->rbac_review->getParentRoleIds($this->obj_ref_id, true);
778 $this->rbac_admin->copyRoleTemplatePermissions(
779 $source,
780 $parentRoles[$source]["parent"],
781 $this->obj_ref_id,
782 $this->object->getId(),
783 false
784 );
785
786 // update object data entry (to update last modification date)
787 $this->object->update();
788
789 // send info
790 $title = ilObject::_lookupTitle($source);
791 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_perm_adopted_from1") . " '" .
792 ilObjRole::_getTranslation($title) . "'.<br/>" .
793 $this->lng->txt("msg_perm_adopted_from2"), true);
794 }
795
796 $this->ctrl->redirect($this, "perm");
797 }
ilAccessHandler $access
static _lookupTitle(int $obj_id)

References ilObjectGUI\$access, ilObjRole\_getTranslation(), ilObject\_lookupTitle(), adoptPermObject(), checkAccess(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ buildConfirmationModal()

ilObjRoleGUI::buildConfirmationModal ( )
private

Definition at line 1317 of file class.ilObjRoleGUI.php.

1317 : InterruptiveModal
1318 {
1319 $message = $this->lng->txt('rbac_role_delete_qst');
1320 if ($this->rbac_review->isAssigned($this->user->getId(), $this->object->getId())) {
1321 $message .= ('<br />' . $this->lng->txt('rbac_role_delete_self'));
1322 }
1323 return $this->ui_factory->modal()->interruptive(
1324 $this->lng->txt('confirm'),
1325 $message,
1326 $this->ctrl->getFormActionByClass(self::class, 'performDeleteRole')
1327 )->withAffectedItems([
1328 $this->ui_factory->modal()->interruptiveItem()->standard(
1329 (string) $this->object->getId(),
1330 $this->object->getTitle()
1331 )
1332 ]);
1333 }

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by buildEditPage(), and permObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildEditPage()

ilObjRoleGUI::buildEditPage ( ?StandardForm  $form = null)
private

Definition at line 408 of file class.ilObjRoleGUI.php.

408 : void
409 {
410 $page_content = [];
411 if ($this->object->getId() != SYSTEM_ROLE_ID) {
412 $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
413 if ($this->rbac_review->isDeleteable($this->object->getId(), $this->obj_ref_id)) {
414 $modal = $this->buildConfirmationModal();
415 $this->toolbar->addComponent(
416 $this->ui_factory->button()->standard(
417 $this->lng->txt('rbac_delete_role'),
418 $modal->getShowSignal()
419 )
420 );
421 $page_content[] = $modal;
422 }
423 }
424
425 $page_content[] = $this->ui_factory->panel()->standard(
426 $this->lng->txt('role_edit'),
427 $form ?? $this->getRoleForm()
428 );
429
430 $this->tpl->setContent(
431 $this->ui_renderer->render($page_content)
432 );
433 }

References buildConfirmationModal(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ILIAS\Repository\object(), SYSTEM_ROLE_ID, and ILIAS\Repository\toolbar().

Referenced by editObject(), and updateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ changeExistingObjectsObject()

ilObjRoleGUI::changeExistingObjectsObject ( )
protected

Definition at line 1188 of file class.ilObjRoleGUI.php.

1188 : void
1189 {
1190 $mode = 0;
1191 if ($this->http->wrapper()->post()->has('mode')) {
1192 $mode = $this->http->wrapper()->post()->retrieve(
1193 'mode',
1194 $this->refinery->kindlyTo()->int()
1195 );
1196 }
1197 $start = ($this->obj_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $this->obj_ref_id);
1198
1199 $type_filter = [];
1200 if ($this->http->wrapper()->post()->has('type_filter')) {
1201 $serialized_type_filter = $this->http->wrapper()->post()->retrieve(
1202 'type_filter',
1203 $this->refinery->kindlyTo()->string()
1204 );
1205 $type_filter = json_decode(
1206 $serialized_type_filter,
1207 true
1208 );
1209 }
1210
1211 $this->object->changeExistingObjects($start, $mode, $type_filter);
1212 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
1213 $this->ctrl->redirect($this, 'perm');
1214 }
const ROOT_FOLDER_ID
Definition: constants.php:32

References $obj_ref_id, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ROLE_FOLDER_ID, and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

◆ checkAccess()

ilObjRoleGUI::checkAccess ( string  $a_perm_global,
string  $a_perm_obj = '' 
)

Definition at line 1098 of file class.ilObjRoleGUI.php.

1098 : bool
1099 {
1100 $a_perm_obj = $a_perm_obj ?: $a_perm_global;
1101
1102 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
1103 return $this->rbac_system->checkAccess($a_perm_global, $this->obj_ref_id);
1104 } else {
1105 return $this->access->checkAccess($a_perm_obj, '', $this->obj_ref_id);
1106 }
1107 }

References ILIAS\Repository\access(), and ROLE_FOLDER_ID.

Referenced by addUserObject(), adoptPermSaveObject(), confirmDeleteRoleObject(), deassignUserObject(), editObject(), getTabs(), performDeleteRoleObject(), permObject(), permSaveObject(), and userassignmentObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeleteRoleObject()

ilObjRoleGUI::confirmDeleteRoleObject ( )
protected

Show delete confirmation screen.

Definition at line 575 of file class.ilObjRoleGUI.php.

575 : void
576 {
577 $this->tabs_gui->clearTargets();
578
579 if (!$this->checkAccess('visible,write', 'edit_permission')) {
580 $this->tpl->setOnScreenMessage('msg_no_perm_perm', $this->lng->txt('permission_denied'), true);
581 $this->ctrl->redirectByClass(ilRepositoryGUI::class);
582 }
583
584 $question = $this->lng->txt('rbac_role_delete_qst');
585 if ($this->rbac_review->isAssigned($this->user->getId(), $this->object->getId())) {
586 $question .= ('<br />' . $this->lng->txt('rbac_role_delete_self'));
587 }
588 $this->tpl->setOnScreenMessage('question', $question);
589
590 $confirm = new ilConfirmationGUI();
591 $confirm->setFormAction($this->ctrl->getFormAction($this));
592 $confirm->setHeaderText($question);
593 $confirm->setCancel($this->lng->txt('cancel'), 'perm');
594 $confirm->setConfirm($this->lng->txt('rbac_delete_role'), 'performDeleteRole');
595
596 $confirm->addItem(
597 'role',
598 (string) $this->object->getId(),
599 ilObjRole::_getTranslation($this->object->getTitle()),
600 ilUtil::getImagePath('standard/icon_role.svg')
601 );
602
603 $this->tpl->setContent($confirm->getHTML());
604 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilObjRole\_getTranslation(), checkAccess(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ createObject()

ilObjRoleGUI::createObject ( )

create new object form

Reimplemented from ilObjectGUI.

Definition at line 298 of file class.ilObjRoleGUI.php.

298 : void
299 {
300 if (!$this->rbac_system->checkAccess('create_role', $this->obj_ref_id)) {
301 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
302 $this->ctrl->returnToParent(ilRepositoryGUI::class);
303 }
304
305 $this->tabs_gui->setBackTarget(
306 $this->lng->txt('cancel'),
307 $this->ctrl->getParentReturnByClass(self::class)
308 );
309
310 $this->tpl->setContent(
311 $this->ui_renderer->render(
312 $this->ui_factory->panel()->standard(
313 $this->lng->txt('role_new'),
314 $this->getRoleForm(true)
315 )
316 )
317 );
318 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ deassignUserObject()

ilObjRoleGUI::deassignUserObject ( )

Definition at line 846 of file class.ilObjRoleGUI.php.

846 : void
847 {
848 if (!$this->checkAccess('edit_userassignment', 'edit_permission')) {
849 $this->ilias->raiseError(
850 $this->lng->txt("msg_no_perm_assign_user_to_role"),
851 $this->ilias->error_obj->MESSAGE
852 );
853 }
854
855 $selected_users = [];
856 if ($this->http->wrapper()->query()->has('user_id')) {
857 $selected_users = [
858 $this->http->wrapper()->query()->retrieve(
859 'user_id',
860 $this->refinery->kindlyTo()->int()
861 )
862 ];
863 }
864 if ($this->http->wrapper()->post()->has('user_id')) {
865 $selected_users = $this->http->wrapper()->post()->retrieve(
866 'user_id',
867 $this->refinery->kindlyTo()->listOf(
868 $this->refinery->kindlyTo()->int()
869 )
870 );
871 }
872 if (count($selected_users) === 0) {
873 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
874 }
875
876 // prevent unassignment of system user from system role
877 if ($this->object->getId() == SYSTEM_ROLE_ID) {
878 if ($admin = array_search(SYSTEM_USER_ID, $selected_users) !== false) {
879 unset($selected_users[$admin]);
880 }
881 }
882
883 // check for each user if the current role is his last global role before deassigning him
884 $last_role = [];
885 $global_roles = $this->rbac_review->getGlobalRoles();
886 foreach ($selected_users as $user) {
887 $assigned_roles = $this->rbac_review->assignedRoles($user);
888 $assigned_global_roles = array_intersect($assigned_roles, $global_roles);
889
890 if (count($assigned_roles) == 1 || count($assigned_global_roles) == 1 && in_array(
891 $this->object->getId(),
892 $assigned_global_roles
893 )) {
894 $userObj = new ilObjUser($user);
895 $last_role[$user] = $userObj->getFullName();
896 unset($userObj);
897 }
898 }
899
900 // ... else perform deassignment
901 foreach ($selected_users as $user) {
902 if (!isset($last_role[$user])) {
903 $this->rbac_admin->deassignUser($this->object->getId(), $user);
904 }
905 }
906
907 // update object data entry (to update last modification date)
908 $this->object->update();
909
910 // raise error if last role was taken from a user...
911 if ($last_role !== []) {
912 $user_list = implode(", ", $last_role);
913 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_is_last_role') . ': ' . $user_list . '<br />' . $this->lng->txt('msg_min_one_role'), true);
914 } else {
915 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_userassignment_changed"), true);
916 }
917 $this->ctrl->redirect($this, 'userassignment');
918 }
User class.
const SYSTEM_USER_ID
This file contains constants for PHPStan analyis, see: https://phpstan.org/config-reference#constants...
Definition: constants.php:26
Class ilObjForumAdministration.

References ilObjectGUI\$user, checkAccess(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), SYSTEM_ROLE_ID, and SYSTEM_USER_ID.

+ Here is the call graph for this function:

◆ editObject()

ilObjRoleGUI::editObject ( )

Reimplemented from ilObjectGUI.

Definition at line 320 of file class.ilObjRoleGUI.php.

320 : void
321 {
322 if (!$this->checkAccess('write', 'edit_permission')) {
323 $this->tpl->setOnScreenMessage('msg_no_perm_write', $this->lng->txt('permission_denied'), true);
324 $this->ctrl->returnToParent($this);
325 }
326 $this->tabs_gui->activateTab('edit_properties');
327
328 $this->buildEditPage();
329 }
buildEditPage(?StandardForm $form=null)

References buildEditPage(), checkAccess(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ ensureRoleAccessForContext()

ilObjRoleGUI::ensureRoleAccessForContext ( )
protected

Ensure access to role for ref_id.

Exceptions
ilObjectException

Definition at line 1289 of file class.ilObjRoleGUI.php.

1289 : bool
1290 {
1291 // creation of roles
1292 if (
1293 !$this->object->getId() ||
1294 $this->object->getId() == ROLE_FOLDER_ID
1295 ) {
1296 return true;
1297 }
1298
1299 $possible_roles = [];
1300 try {
1301 $possible_roles = $this->rbac_review->getRolesOfObject(
1302 $this->obj_ref_id,
1303 false
1304 );
1305 } catch (\InvalidArgumentException $e) {
1306 $this->logger->warning('Role access check failed: ' . $e);
1307 throw new \ilObjectException($this->lng->txt('permission_denied'));
1308 }
1309
1310 if (!in_array($this->object->getId(), $possible_roles)) {
1311 $this->logger->warning('Object id: ' . $this->object->getId() . ' is not accessible for ref_id: ' . $this->obj_ref_id);
1312 throw new \ilObjectException($this->lng->txt('permission_denied'));
1313 }
1314 return true;
1315 }

References Vendor\Package\$e, ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\object(), and ROLE_FOLDER_ID.

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjRoleGUI::executeCommand ( )

Reimplemented from ilObjectGUI.

Definition at line 85 of file class.ilObjRoleGUI.php.

85 : void
86 {
87 $this->prepareOutput();
88
89 $next_class = $this->ctrl->getNextClass($this);
90 $cmd = $this->ctrl->getCmd();
91
93
94 switch ($next_class) {
95 case 'ilrepositorysearchgui':
96
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
101 );
102 }
103 $rep_search = new ilRepositorySearchGUI();
104 $rep_search->setTitle($this->lng->txt('role_add_user'));
105 $rep_search->setCallback($this, 'addUserObject');
106
107 // Set tabs
108 $this->tabs_gui->setTabActive('user_assignment');
109 $this->ctrl->setReturn($this, 'userassignment');
110 $ret = $this->ctrl->forwardCommand($rep_search);
111 break;
112
113 case 'ilexportgui':
114
115 $this->tabs_gui->setTabActive('export');
116
118 $eo->addOption(ilExportOptions::KEY_ROOT, 0, $this->object->getId(), $this->obj_ref_id);
119
120 $exp = new ilExportGUI($this, new ilObjRole($this->object->getId()), false);
121 $this->ctrl->forwardCommand($exp);
122 break;
123
124 case 'ilrecommendedcontentroleconfiggui':
125 $this->tabs_gui->setTabActive('rep_recommended_content');
126 $ui = new ilRecommendedContentRoleConfigGUI($this->object->getId(), $this->obj_ref_id);
127 $this->ctrl->forwardCommand($ui);
128 break;
129
130 default:
131 if (!$cmd) {
132 if ($this->showDefaultPermissionSettings()) {
133 $cmd = "perm";
134 } else {
135 $cmd = 'userassignment';
136 }
137 }
138 $cmd .= "Object";
139 $this->$cmd();
140
141 break;
142 }
143 }
error(string $a_errmsg)
Export User Interface Class.
static newInstance(int $a_export_id)
ensureRoleAccessForContext()
Ensure access to role for ref_id.
showDefaultPermissionSettings()
check if default permissions are shown or not
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\access(), ilExportOptions\allocateExportId(), ILIAS\Repository\ctrl(), ensureRoleAccessForContext(), error(), ilExportOptions\KEY_ROOT, ILIAS\Repository\lng(), ilExportOptions\newInstance(), ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), and showDefaultPermissionSettings().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleGUI::getAdminTabs ( )

admin and normal tabs are equal for roles

Reimplemented from ilObjectGUI.

Definition at line 211 of file class.ilObjRoleGUI.php.

211 : void
212 {
213 $this->getTabs();
214 }
getTabs()
@abstract overwrite in derived GUI class of your object type

References getTabs().

+ Here is the call graph for this function:

◆ getContainerType()

ilObjRoleGUI::getContainerType ( )
protected

Get type of role container.

Definition at line 219 of file class.ilObjRoleGUI.php.

219 : string
220 {
222 }

References $container_type.

Referenced by showDefaultPermissionSettings().

+ Here is the caller graph for this function:

◆ getParentObjId()

ilObjRoleGUI::getParentObjId ( )

Get obj_id of current object.

Definition at line 195 of file class.ilObjRoleGUI.php.

195 : int
196 {
197 return $this->obj_obj_id;
198 }

References $obj_obj_id.

◆ getParentRefId()

ilObjRoleGUI::getParentRefId ( )

Get ref id of current object (not role folder id)

Definition at line 187 of file class.ilObjRoleGUI.php.

187 : int
188 {
189 return $this->obj_ref_id;
190 }

References $obj_ref_id.

Referenced by permObject().

+ Here is the caller graph for this function:

◆ getParentType()

ilObjRoleGUI::getParentType ( )

get type of current object (not role folder)

Definition at line 203 of file class.ilObjRoleGUI.php.

203 : string
204 {
205 return $this->obj_obj_type;
206 }

References $obj_obj_type.

Referenced by permObject(), and permSaveObject().

+ Here is the caller graph for this function:

◆ getRoleForm()

ilObjRoleGUI::getRoleForm ( bool  $is_role_creation_form = false)
protected

Definition at line 233 of file class.ilObjRoleGUI.php.

233 : StandardForm
234 {
235 if ($this->creation_mode) {
236 $this->ctrl->setParameter($this, 'new_type', 'role');
237 }
238
239 $ff = $this->ui_factory->input()->field();
240
241 $title_validation_constraint = $this->refinery->custom()->constraint(
242 fn(string $v): bool => preg_match('/^il_.*$/', $v) ? false : true,
243 $this->lng->txt('msg_role_reserved_prefix')
244 );
245
246 $role_is_autogenerated = false;
247
248 if (!$is_role_creation_form) {
249 $role_is_autogenerated = $this->object->isAutoGenerated();
250 }
251
252 $inputs = [
253 self::FORM_KEY_TITLE => $ff->text($this->lng->txt('title'))
254 ->withMaxLength(70)
255 ->withRequired(true)
256 ->withAdditionalTransformation($title_validation_constraint)
257 ->withValue($is_role_creation_form ? '' : $this->object->getTitle())
258 ->withDisabled($role_is_autogenerated),
259 self::FORM_KEY_DESCRIPTION => $ff->textarea($this->lng->txt('description'))
260 ->withMaxLimit(4000)
261 ->withValue($is_role_creation_form ? '' : $this->object->getDescription())
262 ->withDisabled($role_is_autogenerated),
263
264 ];
265
266 if (!$is_role_creation_form) {
267 $inputs[self::FORM_KEY_ILIAS_ID] = $ff->text($this->lng->txt('ilias_id'))
268 ->withDisabled(true)
269 ->withValue('il_' . IL_INST_ID . '_'
270 . $this->object->getType() . '_' . $this->object->getId());
271 }
272
273 if ($this->obj_ref_id === ROLE_FOLDER_ID) {
274 $inputs[self::FORM_KEY_ON_REGISTRATION_FORM] = $ff->checkbox($this->lng->txt('allow_register'))
275 ->withValue($is_role_creation_form ? false : $this->object->getAllowRegister());
276 $inputs[self::FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT] = $ff->checkbox($this->lng->txt('allow_assign_users'))
277 ->withValue($is_role_creation_form ? false : $this->object->getAssignUsersStatus());
278 }
279
280 $inputs[self::FORM_KEY_PROTECT] = $ff->checkbox($this->lng->txt('role_protect_permissions'))
281 ->withValue(
282 $is_role_creation_form
283 ? false
284 : $this->rbac_review->isProtected($this->obj_ref_id, $this->object->getId())
285 );
286
287 return $this->ui_factory->input()->container()->form()->standard(
288 $this->ctrl->getFormActionByClass(
289 self::class,
290 $is_role_creation_form ? 'save' : 'update'
291 ),
292 $inputs
293 )->withSubmitLabel(
294 $is_role_creation_form ? $this->lng->txt('role_new') : $this->lng->txt('save')
295 );
296 }
const FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT
const FORM_KEY_ON_REGISTRATION_FORM
const IL_INST_ID
Definition: constants.php:40

References ILIAS\UI\Implementation\Component\Input\$inputs, ILIAS\Repository\ctrl(), FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT, FORM_KEY_ILIAS_ID, FORM_KEY_ON_REGISTRATION_FORM, FORM_KEY_PROTECT, IL_INST_ID, ILIAS\Repository\lng(), ILIAS\Repository\object(), ILIAS\Repository\refinery(), and ROLE_FOLDER_ID.

Referenced by saveObject(), and updateObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRoleId()

ilObjRoleGUI::getRoleId ( )
protected

Definition at line 145 of file class.ilObjRoleGUI.php.

145 : int
146 {
147 return $this->role_id;
148 }

References $role_id.

Referenced by addLocatorItems().

+ Here is the caller graph for this function:

◆ getTabs()

ilObjRoleGUI::getTabs ( )
protected

@abstract overwrite in derived GUI class of your object type

Reimplemented from ilObjectGUI.

Definition at line 1013 of file class.ilObjRoleGUI.php.

1013 : void
1014 {
1015 $base_role_container = $this->rbac_review->getFoldersAssignedToRole($this->object->getId(), true);
1016 $activate_role_edit = false;
1017
1018 // todo: activate the following (allow editing of local roles in
1019 // roles administration)
1020 if (
1021 in_array($this->obj_ref_id, $base_role_container) ||
1022 $this->getAdminMode() === self::ADMIN_MODE_SETTINGS
1023 ) {
1024 $activate_role_edit = true;
1025 }
1026
1027 // not so nice (workaround for using tabs in repository)
1028 $this->tabs_gui->clearTargets();
1029
1030 $this->help->setScreenIdComponent('role');
1031 $this->tabs_gui->setBackTarget(
1032 $this->lng->txt('btn_back'),
1033 (string) $this->ctrl->getParentReturn($this)
1034 );
1035 if ($this->checkAccess('write', 'edit_permission') && $activate_role_edit) {
1036 $this->tabs_gui->addTarget(
1037 "edit_properties",
1038 $this->ctrl->getLinkTarget($this, "edit"),
1039 ["edit", "update"],
1040 get_class($this)
1041 );
1042 }
1043 if ($this->checkAccess('write', 'edit_permission') && $this->showDefaultPermissionSettings()) {
1044 $this->tabs_gui->addTarget(
1045 'default_perm_settings',
1046 $this->ctrl->getLinkTarget($this, 'perm'),
1047 [],
1048 get_class($this)
1049 );
1050 }
1051
1052 if ($this->checkAccess(
1053 'write',
1054 'edit_permission'
1055 ) && $activate_role_edit && $this->object->getId() != ANONYMOUS_ROLE_ID) {
1056 $this->tabs_gui->addTarget(
1057 'user_assignment',
1058 $this->ctrl->getLinkTarget($this, 'userassignment'),
1059 ['deassignUser', 'userassignment', 'assignUser', 'searchUserForm', 'search'],
1060 get_class($this)
1061 );
1062 }
1063
1064 if ($this->checkAccess(
1065 'write',
1066 'edit_permission'
1067 ) && $activate_role_edit && $this->object->getId() != ANONYMOUS_ROLE_ID) {
1068 $this->lng->loadLanguageModule('rep');
1069 $this->tabs_gui->addTarget(
1070 'rep_recommended_content',
1071 $this->ctrl->getLinkTargetByClass('ilrecommendedcontentroleconfiggui', '')
1072 );
1073 }
1074 if ($this->checkAccess('write', 'edit_permission')) {
1075 $this->tabs_gui->addTarget(
1076 'export',
1077 $this->ctrl->getLinkTargetByClass('ilExportGUI'),
1078 []
1079 );
1080 }
1081 }
const ANONYMOUS_ROLE_ID
Definition: constants.php:28

References ANONYMOUS_ROLE_ID, checkAccess(), ILIAS\Repository\ctrl(), ilObjectGUI\getAdminMode(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and showDefaultPermissionSettings().

Referenced by getAdminTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initParentRefId()

ilObjRoleGUI::initParentRefId ( )
protected

Definition at line 150 of file class.ilObjRoleGUI.php.

150 : void
151 {
152 $this->obj_ref_id = 0;
153
154 if ($this->http->wrapper()->query()->has('rolf_ref_id')) {
155 $this->obj_ref_id = $this->http->wrapper()->query()->retrieve(
156 'rolf_ref_id',
157 $this->refinery->kindlyTo()->int()
158 );
159 } elseif ($this->http->wrapper()->query()->has('ref_id')) {
160 $this->obj_ref_id = $this->http->wrapper()->query()->retrieve(
161 'ref_id',
162 $this->refinery->kindlyTo()->int()
163 );
164 }
165 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ isChangeExistingObjectsConfirmationRequired()

ilObjRoleGUI::isChangeExistingObjectsConfirmationRequired ( )
protected

Check if a confirmation about further settings is required or not.

Definition at line 1112 of file class.ilObjRoleGUI.php.

1112 : bool
1113 {
1114 // Role is protected
1115 if ($this->rbac_review->isProtected($this->obj_ref_id, $this->object->getId())) {
1116 // TODO: check if recursive_list is enabled
1117 // and if yes: check if inheritance is broken for the relevant object types
1118 return count($this->rbac_review->getFoldersAssignedToRole($this->object->getId())) > 1;
1119 } else {
1120 // TODO: check if recursive_list is enabled
1121 // and if yes: check if inheritance is broken for the relevant object types
1122 return count($this->rbac_review->getFoldersAssignedToRole($this->object->getId())) > 1;
1123 }
1124 }

Referenced by permSaveObject().

+ Here is the caller graph for this function:

◆ mailToRoleObject()

ilObjRoleGUI::mailToRoleObject ( )

Definition at line 1083 of file class.ilObjRoleGUI.php.

1083 : void
1084 {
1085 $mail_roles = (array) (ilSession::get('mail_roles') ?? []);
1086
1087 $obj_ids = ilObject::_getIdsForTitle($this->object->getTitle(), $this->object->getType());
1088 if (count($obj_ids) > 1) {
1089 $mail_roles[] = '#il_role_' . $this->object->getId();
1090 } else {
1091 $mail_roles[] = (new \ilRoleMailboxAddress($this->object->getId()))->value();
1092 }
1093 ilSession::set('mail_roles', $mail_roles);
1094 $script = ilMailFormCall::getRedirectTarget($this, 'userassignment', [], ['type' => 'role']);
1095 ilUtil::redirect($script);
1096 }
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _getIdsForTitle(string $title, string $type='', bool $partial_match=false)
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
static redirect(string $a_script)

References ilObject\_getIdsForTitle(), ilSession\get(), ilMailFormCall\getRedirectTarget(), ILIAS\Repository\object(), ilUtil\redirect(), and ilSession\set().

+ Here is the call graph for this function:

◆ performDeleteRoleObject()

ilObjRoleGUI::performDeleteRoleObject ( )
protected

Delete role.

Definition at line 609 of file class.ilObjRoleGUI.php.

609 : void
610 {
611 if (!$this->checkAccess('visible,write', 'edit_permission')) {
612 $this->tpl->setOnScreenMessage('msg_no_perm_perm', $this->lng->txt('permission_denied'), true);
613 $this->ctrl->redirectByClass(ilRepositoryGUI::class);
614 }
615
616 $this->object->setParent($this->obj_ref_id);
617 $this->object->delete();
618 $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_deleted_role'), true);
619
620 $this->ctrl->returnToParent($this);
621 }

References checkAccess(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ permObject()

ilObjRoleGUI::permObject ( bool  $a_show_admin_permissions = false)
protected

Definition at line 435 of file class.ilObjRoleGUI.php.

435 : void
436 {
437 $this->tabs_gui->setTabActive('default_perm_settings');
438
439 $this->setSubTabs('default_perm_settings');
440
441 if (!$this->checkAccess('write', 'edit_permission')) {
442 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_write'), true);
443 $this->ctrl->returnToParent($this);
444 }
445
446 if ($a_show_admin_permissions) {
447 $this->tabs_gui->setSubTabActive('rbac_admin_permissions');
448 } else {
449 $this->tabs_gui->setSubTabActive('rbac_repository_permissions');
450 }
451
452 $this->tpl->addBlockFile(
453 'ADM_CONTENT',
454 'adm_content',
455 'tpl.rbac_template_permissions.html',
456 'components/ILIAS/AccessControl'
457 );
458
459 if ($this->object->getId() !== SYSTEM_ROLE_ID) {
460 $this->toolbar->setFormAction($this->ctrl->getFormAction($this));
461 $this->toolbar->addComponent(
462 $this->ui_factory->link()->standard(
463 $this->lng->txt("adopt_perm_from_template"),
464 $this->ctrl->getLinkTarget($this, 'adoptPerm')
465 )
466 );
467 if ($this->rbac_review->isDeleteable($this->object->getId(), $this->obj_ref_id)) {
468 $modal = $this->buildConfirmationModal();
469 $this->toolbar->addComponent(
470 $this->ui_factory->button()->standard(
471 $this->lng->txt('rbac_delete_role'),
472 $modal->getShowSignal()
473 )
474 );
475 $this->tpl->setVariable('DELETION_MODAL', $this->ui_renderer->render($modal));
476 }
477 }
478
479 $this->tpl->setVariable('PERM_ACTION', $this->ctrl->getFormAction($this));
480
481 $acc = new ilAccordionGUI();
482 $acc->setBehaviour(ilAccordionGUI::FORCE_ALL_OPEN);
483 $acc->setId('template_perm_' . $this->getParentRefId());
484
485 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
486 if ($a_show_admin_permissions) {
487 $subs = ilObjRole::getSubObjects('adm', true);
488 } else {
489 $subs = ilObjRole::getSubObjects('root', false);
490 }
491 } else {
492 $subs = ilObjRole::getSubObjects($this->getParentType(), $a_show_admin_permissions);
493 }
494
495 foreach ($subs as $subtype => $def) {
497 $this,
498 'perm',
499 $this->getParentRefId(),
500 $this->object->getId(),
501 $subtype,
502 $a_show_admin_permissions
503 );
504 $tbl->parse();
505
506 $acc->addItem($def['translation'], $tbl->getHTML());
507 }
508
509 $this->tpl->setVariable('ACCORDION', $acc->getHTML());
510
511 // Add options table
513 $this,
514 'perm',
515 $this->obj_ref_id,
516 $this->object->getId(),
517 $a_show_admin_permissions
518 );
519 if ($this->object->getId() != SYSTEM_ROLE_ID) {
520 $options->addMultiCommand(
521 $a_show_admin_permissions ? 'adminPermSave' : 'permSave',
522 $this->lng->txt('save')
523 );
524 }
525
526 $options->parse();
527 $this->tpl->setVariable('OPTIONS_TABLE', $options->getHTML());
528 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getParentType()
get type of current object (not role folder)
getParentRefId()
Get ref id of current object (not role folder id)

References ILIAS\UI\Implementation\Component\Input\Field\$options, buildConfirmationModal(), checkAccess(), ILIAS\Repository\ctrl(), ilAccordionGUI\FORCE_ALL_OPEN, getParentRefId(), getParentType(), ILIAS\Repository\lng(), ILIAS\Repository\object(), ROLE_FOLDER_ID, setSubTabs(), SYSTEM_ROLE_ID, and ILIAS\Repository\toolbar().

Referenced by adminPermObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ permSaveObject()

ilObjRoleGUI::permSaveObject ( bool  $a_show_admin_permissions = false)

save permissions @access public

Definition at line 627 of file class.ilObjRoleGUI.php.

627 : void
628 {
629 if (!$this->checkAccess('visible,write', 'edit_permission')) {
630 $this->tpl->setOnScreenMessage('msg_no_perm_perm', $this->lng->txt('permission_denied'), true);
631 $this->ctrl->redirectByClass(ilRepositoryGUI::class);
632 }
633
634 // rbac log
635 $rbac_log_active = ilRbacLog::isActive();
636 if ($rbac_log_active) {
637 $rbac_log_old = ilRbacLog::gatherTemplate($this->obj_ref_id, $this->object->getId());
638 }
639
640 // delete all template entries of enabled types
641 if ($this->obj_ref_id == ROLE_FOLDER_ID) {
642 if ($a_show_admin_permissions) {
643 $subs = ilObjRole::getSubObjects('adm', true);
644 } else {
645 $subs = ilObjRole::getSubObjects('root', false);
646 }
647 } else {
648 $subs = ilObjRole::getSubObjects($this->getParentType(), $a_show_admin_permissions);
649 }
650
651 foreach (array_keys($subs) as $subtype) {
652 // Delete per object type
653 $this->rbac_admin->deleteRolePermission($this->object->getId(), $this->obj_ref_id, $subtype);
654 }
655
656 $template_permissions = $this->retrieveTemplatePermissionsFromPost();
657 foreach ($template_permissions as $key => $ops_array) {
658 // sets new template permissions
659 $this->rbac_admin->setRolePermission($this->object->getId(), $key, $ops_array, $this->obj_ref_id);
660 }
661
662 if ($rbac_log_active) {
663 $rbac_log_new = ilRbacLog::gatherTemplate($this->obj_ref_id, $this->object->getId());
664 $rbac_log_diff = ilRbacLog::diffTemplate($rbac_log_old, $rbac_log_new);
665 ilRbacLog::add(ilRbacLog::EDIT_TEMPLATE, $this->obj_ref_id, $rbac_log_diff);
666 }
667
668 // update object data entry (to update last modification date)
669 $this->object->update();
670
671 // set protected flag
672 $protected = false;
673 if ($this->http->wrapper()->post()->has('protected')) {
674 $protected = $this->http->wrapper()->post()->retrieve(
675 'protected',
676 $this->refinery->kindlyTo()->bool()
677 );
678 }
679 if (
680 $this->obj_ref_id == ROLE_FOLDER_ID ||
681 $this->rbac_review->isAssignable($this->object->getId(), $this->obj_ref_id)) {
682 $this->rbac_admin->setProtected($this->obj_ref_id, $this->object->getId(), ilUtil::tf2yn($protected));
683 }
684 $recursive = false;
685 if ($this->http->wrapper()->post()->has('recursive')) {
686 $recursive = $this->http->wrapper()->post()->retrieve(
687 'recursive',
688 $this->refinery->kindlyTo()->bool()
689 );
690 }
691 // aka change existing object for specific object types
692 $recursive_list = [];
693 if ($this->http->wrapper()->post()->has('recursive_list')) {
694 $recursive_list = $this->http->wrapper()->post()->retrieve(
695 'recursive_list',
696 $this->refinery->kindlyTo()->listOf(
697 $this->refinery->kindlyTo()->string()
698 )
699 );
700 }
701 if ($a_show_admin_permissions) {
702 $recursive = true;
703 }
704
705 // Redirect if Change existing objects is not chosen
706 if (!$recursive && !count($recursive_list)) {
707 $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
708 if ($a_show_admin_permissions) {
709 $this->ctrl->redirect($this, 'adminPerm');
710 } else {
711 $this->ctrl->redirect($this, 'perm');
712 }
713 }
714 // New implementation
715 if (
716 ($recursive || count($recursive_list)) &&
718 !$a_show_admin_permissions
719 ) {
720 $this->showChangeExistingObjectsConfirmation($recursive, $recursive_list);
721 return;
722 }
723
724 $start = ($this->obj_ref_id == ROLE_FOLDER_ID ? ROOT_FOLDER_ID : $this->obj_ref_id);
725 if ($a_show_admin_permissions) {
726 $start = $this->tree->getParentId($this->obj_ref_id);
727 }
728
729 if ($protected) {
730 $this->object->changeExistingObjects(
731 $start,
733 ['all'],
734 []
735 );
736 } else {
737 $this->object->changeExistingObjects(
738 $start,
740 ['all'],
741 []
742 );
743 }
744 $this->tpl->setOnScreenMessage('success', $this->lng->txt("saved_successfully"), true);
745
746 if ($a_show_admin_permissions) {
747 $this->ctrl->redirect($this, 'adminPerm');
748 } else {
749 $this->ctrl->redirect($this, 'perm');
750 }
751 }
showChangeExistingObjectsConfirmation(bool $recursive, array $recursive_list)
Show confirmation screen.
isChangeExistingObjectsConfirmationRequired()
Check if a confirmation about further settings is required or not.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
static diffTemplate(array $old, array $new)
static add(int $action, int $ref_id, array $diff, bool $source_ref_id=false)
static gatherTemplate(int $role_ref_id, int $role_id)
const EDIT_TEMPLATE
static isActive()
static tf2yn(bool $a_tf)

References $obj_ref_id, ilRbacLog\add(), checkAccess(), ILIAS\Repository\ctrl(), ilRbacLog\diffTemplate(), ilRbacLog\EDIT_TEMPLATE, ilRbacLog\gatherTemplate(), getParentType(), ILIAS\FileDelivery\http(), ilRbacLog\isActive(), isChangeExistingObjectsConfirmationRequired(), ILIAS\Repository\lng(), ilObjRole\MODE_PROTECTED_KEEP_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, ILIAS\Repository\object(), ILIAS\Repository\refinery(), retrieveTemplatePermissionsFromPost(), ROLE_FOLDER_ID, ROOT_FOLDER_ID, showChangeExistingObjectsConfirmation(), and ilUtil\tf2yn().

Referenced by adminPermSaveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ retrieveTemplatePermissionsFromPost()

ilObjRoleGUI::retrieveTemplatePermissionsFromPost ( )
protected

Definition at line 167 of file class.ilObjRoleGUI.php.

167 : array
168 {
169 $template_permissions = [];
170 if ($this->http->wrapper()->post()->has('template_perm')) {
171 $custom_transformer = $this->refinery->custom()->transformation(
172 function ($array) {
173 return $array;
174 }
175 );
176 $template_permissions = $this->http->wrapper()->post()->retrieve(
177 'template_perm',
178 $custom_transformer
179 );
180 }
181 return $template_permissions;
182 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by permSaveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilObjRoleGUI::saveObject ( )

Save new role.

Returns

Reimplemented from ilObjectGUI.

Definition at line 335 of file class.ilObjRoleGUI.php.

335 : void
336 {
337 $form = $this->getRoleForm(true)->withRequest($this->request);
338 $data = $form->getData();
339 if ($data === null) {
340 $this->tabs_gui->setBackTarget(
341 $this->lng->txt('cancel'),
342 $this->ctrl->getParentReturnByClass(self::class)
343 );
344 $this->tpl->setContent(
345 $this->ui_renderer->render(
346 $this->ui_factory->panel()->standard(
347 $this->lng->txt('role_new'),
348 $form
349 )
350 )
351 );
352 return;
353 }
354
355 $role = new ilObjRole();
356 $role->setTitle($data[self::FORM_KEY_TITLE]);
357 $role->setDescription($data[self::FORM_KEY_DESCRIPTION]);
358 $role->setAllowRegister($data[self::FORM_KEY_ON_REGISTRATION_FORM]);
359 $role->toggleAssignUsersStatus($data[self::FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT]);
360 $role->create();
361 $this->rbac_admin->assignRoleToFolder($role->getId(), $this->obj_ref_id, 'y');
362 $this->rbac_admin->setProtected(
363 $this->obj_ref_id,
364 $role->getId(),
365 $data[self::FORM_KEY_PROTECT] ? 'y' : 'n'
366 );
367 $this->tpl->setOnScreenMessage('success', $this->lng->txt('role_added'), true);
368 $this->ctrl->setParameter($this, 'obj_id', $role->getId());
369 $this->ctrl->redirect($this, 'perm');
370 }
getRoleForm(bool $is_role_creation_form=false)

References ilObjectGUI\$data, ILIAS\Repository\ctrl(), getRoleForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ setSubTabs()

ilObjRoleGUI::setSubTabs (   $a_tab)
protected

Definition at line 1216 of file class.ilObjRoleGUI.php.

1216 : void
1217 {
1218 switch ($a_tab) {
1219 case 'default_perm_settings':
1220 if ($this->obj_ref_id != ROLE_FOLDER_ID) {
1221 return;
1222 }
1223 $this->tabs_gui->addSubTabTarget(
1224 'rbac_repository_permissions',
1225 $this->ctrl->getLinkTarget($this, 'perm')
1226 );
1227 $this->tabs_gui->addSubTabTarget(
1228 'rbac_admin_permissions',
1229 $this->ctrl->getLinkTarget($this, 'adminPerm')
1230 );
1231 }
1232 }

References ILIAS\Repository\ctrl(), and ROLE_FOLDER_ID.

Referenced by permObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showChangeExistingObjectsConfirmation()

ilObjRoleGUI::showChangeExistingObjectsConfirmation ( bool  $recursive,
array  $recursive_list 
)
protected

Show confirmation screen.

Parameters
string[]$recursive_list

Definition at line 1130 of file class.ilObjRoleGUI.php.

1130 : void
1131 {
1132 $protected = false;
1133 if ($this->http->wrapper()->post()->has('protected')) {
1134 $protected = $this->http->wrapper()->post()->retrieve(
1135 'protected',
1136 $this->refinery->kindlyTo()->bool()
1137 );
1138 }
1139 $form = new ilPropertyFormGUI();
1140 $form->setFormAction($this->ctrl->getFormAction($this, 'changeExistingObjects'));
1141 $form->setTitle($this->lng->txt('rbac_change_existing_confirm_tbl'));
1142
1143 $form->addCommandButton('changeExistingObjects', $this->lng->txt('change_existing_objects'));
1144 $form->addCommandButton('perm', $this->lng->txt('cancel'));
1145
1146 $hidden = new ilHiddenInputGUI('type_filter');
1147 $hidden->setValue($recursive ? json_encode(['all']) : json_encode($recursive_list));
1148 $form->addItem($hidden);
1149
1150 $rad = new ilRadioGroupInputGUI($this->lng->txt('rbac_local_policies'), 'mode');
1151
1152 if ($protected) {
1153 $rad->setValue((string) ilObjRole::MODE_PROTECTED_DELETE_LOCAL_POLICIES);
1154 $keep = new ilRadioOption(
1155 $this->lng->txt('rbac_keep_local_policies'),
1157 $this->lng->txt('rbac_keep_local_policies_info')
1158 );
1159 } else {
1160 $rad->setValue((string) ilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES);
1161 $keep = new ilRadioOption(
1162 $this->lng->txt('rbac_keep_local_policies'),
1163 (string) ilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES,
1164 $this->lng->txt('rbac_unprotected_keep_local_policies_info')
1165 );
1166 }
1167 $rad->addOption($keep);
1168
1169 if ($protected) {
1170 $del = new ilRadioOption(
1171 $this->lng->txt('rbac_delete_local_policies'),
1173 $this->lng->txt('rbac_delete_local_policies_info')
1174 );
1175 } else {
1176 $del = new ilRadioOption(
1177 $this->lng->txt('rbac_delete_local_policies'),
1179 $this->lng->txt('rbac_unprotected_delete_local_policies_info')
1180 );
1181 }
1182 $rad->addOption($del);
1183
1184 $form->addItem($rad);
1185 $this->tpl->setContent($form->getHTML());
1186 }
This class represents a hidden form property in a property form.
const MODE_PROTECTED_DELETE_LOCAL_POLICIES
const MODE_UNPROTECTED_DELETE_LOCAL_POLICIES
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilObjRole\MODE_PROTECTED_DELETE_LOCAL_POLICIES, ilObjRole\MODE_PROTECTED_KEEP_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_DELETE_LOCAL_POLICIES, ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, and ILIAS\Repository\refinery().

Referenced by permSaveObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showDefaultPermissionSettings()

ilObjRoleGUI::showDefaultPermissionSettings ( )
protected

check if default permissions are shown or not

Definition at line 227 of file class.ilObjRoleGUI.php.

227 : bool
228 {
229 return $this->obj_definition->isContainer($this->getContainerType())
230 || $this->obj_definition->isAdministrationObject($this->getContainerType());
231 }
getContainerType()
Get type of role container.

References getContainerType().

Referenced by executeCommand(), and getTabs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateObject()

ilObjRoleGUI::updateObject ( )

Save role settings.

Returns

Reimplemented from ilObjectGUI.

Definition at line 376 of file class.ilObjRoleGUI.php.

376 : void
377 {
378 $form = $this->getRoleForm()->withRequest($this->request);
379 $data = $form->getData();
380 if ($data === null) {
381 $this->buildEditPage($form);
382 return;
383 }
384
385 if (isset($data[self::FORM_KEY_TITLE])) {
386 $this->object->setTitle($data[self::FORM_KEY_TITLE]);
387 }
388 if (isset($data[self::FORM_KEY_DESCRIPTION])) {
389 $this->object->setDescription($data[self::FORM_KEY_DESCRIPTION]);
390 }
391 if (isset($data[self::FORM_KEY_ON_REGISTRATION_FORM])) {
392 $this->object->setAllowRegister($data[self::FORM_KEY_ON_REGISTRATION_FORM]);
393 }
394 if (isset($data[self::FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT])) {
395 $this->object->toggleAssignUsersStatus($data[self::FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT]);
396 }
397 $this->object->update();
398 $this->rbac_admin->setProtected(
399 $this->obj_ref_id,
400 $this->object->getId(),
401 $data[self::FORM_KEY_PROTECT] ? 'y' : 'n'
402 );
403
404 $this->tpl->setOnScreenMessage('success', $this->lng->txt('saved_successfully'), true);
405 $this->ctrl->redirect($this, 'edit');
406 }

References ilObjectGUI\$data, buildEditPage(), ILIAS\Repository\ctrl(), getRoleForm(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ userassignmentObject()

ilObjRoleGUI::userassignmentObject ( )

display user assignment panel

Definition at line 923 of file class.ilObjRoleGUI.php.

923 : void
924 {
925 if (!$this->checkAccess('edit_userassignment', 'edit_permission')) {
926 $this->tpl->setOnScreenMessage(
927 $this->lng->txt("msg_no_perm_assign_user_to_role"),
928 );
929 return;
930 }
931
932 $this->tabs_gui->setTabActive('user_assignment');
933
934 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rbac_ua.html', 'components/ILIAS/AccessControl');
935
936 $tb = new ilToolbarGUI();
937
938 // protected admin role
939 if ($this->object->getId() != SYSTEM_ROLE_ID
940 || ($this->rbac_review->isAssigned($this->user->getId(), SYSTEM_ROLE_ID)
941 || !ilSecuritySettings::_getInstance()->isAdminRoleProtected())) {
942 // add member
944 $this,
945 $tb,
946 [
947 'auto_complete_name' => $this->lng->txt('user'),
948 'submit_name' => $this->lng->txt('add')
949 ]
950 );
951
952 $tb->addSpacer();
953
954 $tb->addComponent(
955 $this->ui_factory->link()->standard(
956 $this->lng->txt('search_user'),
957 $this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start')
958 )
959 );
960 $tb->addSpacer();
961 }
962
963 $tb->addComponent(
964 $this->ui_factory->link()->standard(
965 $this->lng->txt('role_mailto'),
966 $this->ctrl->getLinkTarget($this, 'mailToRole')
967 )
968 );
969 $this->tpl->setVariable('BUTTONS_UA', $tb->getHTML());
970
971 $role_assignment_editable = true;
972 if (
973 $this->object->getId() == SYSTEM_ROLE_ID &&
974 !ilSecuritySettings::_getInstance()->checkAdminRoleAccessible($this->user->getId())) {
975 $role_assignment_editable = false;
976 }
977 $ut = new ilAssignedUsersTableGUI(
978 $this,
979 'userassignment',
980 $this->ui_factory,
981 $this->ui_renderer,
982 $this->object->getId(),
983 $role_assignment_editable,
984 $this->getAdminMode() === self::ADMIN_MODE_SETTINGS
985 );
986 $this->tpl->setVariable('TABLE_UA', $ut->getHTML());
987 }
TableGUI class for role administration.
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 _getInstance()
Get instance of ilSecuritySettings.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilSecuritySettings\_getInstance(), checkAccess(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\lng(), ILIAS\Repository\object(), and SYSTEM_ROLE_ID.

+ Here is the call graph for this function:

Field Documentation

◆ $container_type

string ilObjRoleGUI::$container_type = ''
protected

Definition at line 47 of file class.ilObjRoleGUI.php.

Referenced by getContainerType().

◆ $help

ilHelpGUI ilObjRoleGUI::$help
protected

Definition at line 49 of file class.ilObjRoleGUI.php.

◆ $logger

ilLogger ilObjRoleGUI::$logger
private

Definition at line 50 of file class.ilObjRoleGUI.php.

◆ $obj_obj_id

int ilObjRoleGUI::$obj_obj_id = 0
protected

Definition at line 45 of file class.ilObjRoleGUI.php.

Referenced by getParentObjId().

◆ $obj_obj_type

string ilObjRoleGUI::$obj_obj_type = ''
protected

Definition at line 46 of file class.ilObjRoleGUI.php.

Referenced by getParentType().

◆ $obj_ref_id

int ilObjRoleGUI::$obj_ref_id = 0
protected

◆ $refinery

Factory ilObjRoleGUI::$refinery
protected

Definition at line 51 of file class.ilObjRoleGUI.php.

◆ $role_id

int ilObjRoleGUI::$role_id = 0
protected

Definition at line 48 of file class.ilObjRoleGUI.php.

Referenced by getRoleId().

◆ $ui_factory

UIFactory ilObjRoleGUI::$ui_factory
protected

Definition at line 52 of file class.ilObjRoleGUI.php.

◆ $ui_renderer

Renderer ilObjRoleGUI::$ui_renderer
protected

Definition at line 53 of file class.ilObjRoleGUI.php.

◆ FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT

const ilObjRoleGUI::FORM_KEY_ALLOW_LOCAL_USER_ASSIGNMENT = 'allow_local_user_assignment'
private

Definition at line 41 of file class.ilObjRoleGUI.php.

Referenced by getRoleForm().

◆ FORM_KEY_DESCRIPTION

const ilObjRoleGUI::FORM_KEY_DESCRIPTION = 'description'
private

Definition at line 38 of file class.ilObjRoleGUI.php.

◆ FORM_KEY_ILIAS_ID

const ilObjRoleGUI::FORM_KEY_ILIAS_ID = 'ilias_id'
private

Definition at line 39 of file class.ilObjRoleGUI.php.

Referenced by getRoleForm().

◆ FORM_KEY_ON_REGISTRATION_FORM

const ilObjRoleGUI::FORM_KEY_ON_REGISTRATION_FORM = 'on_registration_form'
private

Definition at line 40 of file class.ilObjRoleGUI.php.

Referenced by getRoleForm().

◆ FORM_KEY_PROTECT

const ilObjRoleGUI::FORM_KEY_PROTECT = 'protect'
private

Definition at line 42 of file class.ilObjRoleGUI.php.

Referenced by getRoleForm().

◆ FORM_KEY_TITLE

const ilObjRoleGUI::FORM_KEY_TITLE = 'title'
private

Definition at line 37 of file class.ilObjRoleGUI.php.


The documentation for this class was generated from the following file: