ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjRoleFolderGUI Class Reference

Class ilObjRoleFolderGUI. More...

+ Inheritance diagram for ilObjRoleFolderGUI:
+ Collaboration diagram for ilObjRoleFolderGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 Constructor public. More...
 
 executeCommand ()
 
 viewObject ()
 ilErrorHandler $ilErr ilRbacSystem $rbacsystem ilToolbarGUI $ilToolbar More...
 
 resetFilterObject ()
 Reset role filter. More...
 
 createObject ()
 role folders are created automatically DEPRECATED !!! public More...
 
 deleteObject ($a_error=false)
 display deletion confirmation screen DEPRECATED !!! public More...
 
 adoptPermSaveObject ()
 ??? TODO: what is the purpose of this function? public More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders More...
 
 saveObject ()
 save object public More...
 
 getAdminTabs ()
 Add role folder tabs ilTree $tree ilLanguage $lng. More...
 
 editSettingsObject (ilPropertyFormGUI $a_form=null)
 
 saveSettingsObject ()
 
 addToExternalSettingsForm ($a_form_id)
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

 $type
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 roleSearchObject ()
 Search target roles. More...
 
 initRoleSearchForm ()
 Init role search form. More...
 
 roleSearchFormObject ()
 Parse search query $ilCtrl. More...
 
 roleSearchListObject ()
 List roles. More...
 
 chooseCopyBehaviourObject (\ilPropertyFormGUI $form=null)
 Choose option for copying roles/role templates. More...
 
 initCopyBehaviourForm (int $copy_source)
 Show copy behaviour form. More...
 
 adjustRoleObject ()
 Copy role. More...
 
 doAddRolePermissions ($source, $target)
 do add role permission More...
 
 removeRolePermissionsObject ()
 Remove role permissions. More...
 
 doRemoveRolePermissions ($source, $target)
 do add role permission More...
 
 doCopyRole ($source, $target)
 Perform copy of role. More...
 
 doChangeExistingObjects ($a_start_obj, $a_target_role, $a_operation_mode, $a_source_role)
 Do change existing objects. More...
 
 applyFilterObject ()
 Apply role filter. More...
 
 confirmDeleteObject ()
 Confirm deletion of roles. More...
 
 deleteRoleObject ()
 Delete roles. More...
 
 initSettingsForm ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Private Attributes

const COPY_ADD_PERMISSIONS = 1
 
const COPY_CLONE_PERMISSIONS = 2
 
const COPY_REMOVE_PERMISSIONS = 3
 
const COPY_CHANGE_EXISTING_OBJECTS = 1
 
 $logger = null
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjRoleFolderGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor public.

Definition at line 62 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjectGUI\$lng, and ILIAS\GlobalScreen\Provider\__construct().

63  {
64  global $DIC;
65 
66  $lng = $DIC['lng'];
67  $this->logger = $DIC->logger()->ac();
68 
69  $this->type = "rolf";
70  parent::__construct($a_data, $a_id, $a_call_by_reference, false);
71  $lng->loadLanguageModule('rbac');
72  }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilObjRoleFolderGUI::addToExternalSettingsForm (   $a_form_id)

Definition at line 970 of file class.ilObjRoleFolderGUI.php.

References ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilAdministrationSettingsFormHandler\FORM_PRIVACY, ilAdministrationSettingsFormHandler\FORM_SECURITY, and ilAdministrationSettingsFormHandler\VALUE_BOOL.

971  {
972  switch ($a_form_id) {
974 
975  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
976  $security = ilSecuritySettings::_getInstance();
977 
978  $fields = array('adm_adm_role_protect' => array($security->isAdminRoleProtected(), ilAdministrationSettingsFormHandler::VALUE_BOOL));
979 
980  return array(array("editSettings", $fields));
981 
983 
984  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
985  $privacy = ilPrivacySettings::_getInstance();
986 
987  $subitems = null;
988  if ((bool) $privacy->enabledRbacLog()) {
989  $subitems = array('rbac_log_age' => $privacy->getRbacLogAge());
990  }
991  $fields = array('rbac_log' => array($privacy->enabledRbacLog(), ilAdministrationSettingsFormHandler::VALUE_BOOL, $subitems));
992 
993  return array(array("editSettings", $fields));
994  }
995  }
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:

◆ adjustRoleObject()

ilObjRoleFolderGUI::adjustRoleObject ( )
protected

Copy role.

Definition at line 411 of file class.ilObjRoleFolderGUI.php.

References $_POST, $DIC, $source, ilObjectGUI\checkPermission(), doAddRolePermissions(), doChangeExistingObjects(), doCopyRole(), doRemoveRolePermissions(), initCopyBehaviourForm(), ilObjRole\MODE_ADD_OPERATIONS, ilObjRole\MODE_READ_OPERATIONS, and ilObjRole\MODE_REMOVE_OPERATIONS.

412  {
413  global $DIC;
414 
415  $this->checkPermission('write');
416  $review = $DIC->rbac()->review();
417 
418  $roles = explode(',', $_POST['roles']);
419  $source = (int) $_REQUEST['csource'];
420 
421  $form = $this->initCopyBehaviourForm($source);
422  if ($form->checkInput()) {
423 
424  $adjustment_type = $form->getInput('type');
425  foreach ((array) $roles as $role_id) {
426  if ($role_id != $source) {
427 
428  $start_obj = $review->getRoleFolderOfRole($role_id);
429  $this->logger->debug('Start object: ' . $start_obj);
430 
431  switch ($adjustment_type) {
432  case self::COPY_ADD_PERMISSIONS:
433  $change_existing = (bool) $form->getInput('add_ce_type');
434  $this->doAddRolePermissions(
435  $source,
436  $role_id
437  );
438  if ($change_existing) {
440  $start_obj,
441  $role_id,
443  $source
444  );
445  }
446  break;
447  case self::COPY_CLONE_PERMISSIONS:
448  $change_existing = (bool) $form->getInput('clone_ce_type');
449  $this->doCopyRole(
450  $source,
451  $role_id
452  );
453  if ($change_existing) {
455  $start_obj,
456  $role_id,
458  $source
459  );
460  }
461  break;
462  case self::COPY_REMOVE_PERMISSIONS:
463  $change_existing = (bool) $form->getInput('remove_ce_type');
465  $source,
466  $role_id
467  );
468  if ($change_existing) {
470  $start_obj,
471  $role_id,
473  $source
474  );
475  }
476  break;
477  }
478  }
479  }
480  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'), true);
481  $this->ctrl->redirect($this, 'view');
482  }
483  }
doAddRolePermissions($source, $target)
do add role permission
initCopyBehaviourForm(int $copy_source)
Show copy behaviour form.
const MODE_REMOVE_OPERATIONS
doCopyRole($source, $target)
Perform copy of role.
const MODE_READ_OPERATIONS
global $DIC
Definition: goto.php:24
const MODE_ADD_OPERATIONS
doRemoveRolePermissions($source, $target)
do add role permission
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
doChangeExistingObjects($a_start_obj, $a_target_role, $a_operation_mode, $a_source_role)
Do change existing objects.
$source
Definition: metadata.php:76
$_POST["username"]
+ Here is the call graph for this function:

◆ adoptPermSaveObject()

ilObjRoleFolderGUI::adoptPermSaveObject ( )

??? TODO: what is the purpose of this function? public

Definition at line 760 of file class.ilObjRoleFolderGUI.php.

761  {
762  ilUtil::sendSuccess($this->lng->txt("saved_successfully"), true);
763 
764  $this->ctrl->redirect($this, "view");
765  }

◆ applyFilterObject()

ilObjRoleFolderGUI::applyFilterObject ( )
protected

Apply role filter.

Definition at line 626 of file class.ilObjRoleFolderGUI.php.

References viewObject().

627  {
628  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
629  $table = new ilRoleTableGUI($this, 'view');
630  $table->init();
631  $table->resetOffset();
632  $table->writeFilterToSession();
633 
634  $this->viewObject();
635  }
TableGUI for the presentation og roles and role templates.
viewObject()
ilErrorHandler $ilErr ilRbacSystem $rbacsystem ilToolbarGUI $ilToolbar
+ Here is the call graph for this function:

◆ chooseCopyBehaviourObject()

ilObjRoleFolderGUI::chooseCopyBehaviourObject ( \ilPropertyFormGUI  $form = null)
protected

Choose option for copying roles/role templates.

Parameters
ilPropertyFormGUI | null$form

Definition at line 278 of file class.ilObjRoleFolderGUI.php.

References $DIC, and initCopyBehaviourForm().

279  {
280  global $DIC;
281 
282  $copy_source = (int) $_REQUEST['csource'];
283 
284  $this->ctrl->saveParameter($this, 'csource', $copy_source);
285  $this->tabs_gui->clearTargets();
286  $this->tabs_gui->setBackTarget(
287  $this->lng->txt('rbac_back_to_overview'),
288  $this->ctrl->getLinkTarget($this, 'view')
289  );
290  if (!$form instanceof \ilPropertyFormGUI) {
291  $form = $this->initCopyBehaviourForm($copy_source);
292  }
293  $this->tpl->setContent($form->getHTML());
294  }
This class represents a property form user interface.
initCopyBehaviourForm(int $copy_source)
Show copy behaviour form.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ confirmDeleteObject()

ilObjRoleFolderGUI::confirmDeleteObject ( )
protected

Confirm deletion of roles.

Definition at line 654 of file class.ilObjRoleFolderGUI.php.

References $_POST, $DIC, ilObjRole\_getTranslation(), ilObject\_lookupTitle(), and ilUtil\sendFailure().

655  {
656  global $DIC;
657 
658  $ilCtrl = $DIC['ilCtrl'];
659 
660  $roles = (array) ($_POST['roles'] ?? []);
661  if (!count($roles)) {
662  ilUtil::sendFailure($this->lng->txt('select_one'), true);
663  $ilCtrl->redirect($this, 'view');
664  }
665 
666  $question = $this->lng->txt('rbac_role_delete_qst');
667 
668  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
669  $confirm = new ilConfirmationGUI();
670  $confirm->setHeaderText($question);
671  $confirm->setFormAction($ilCtrl->getFormAction($this));
672  $confirm->setHeaderText($this->lng->txt("info_delete_sure"));
673  $confirm->setConfirm($this->lng->txt('delete'), 'deleteRole');
674  $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
675 
676 
677  include_once './Services/AccessControl/classes/class.ilObjRole.php';
678  foreach ($roles as $role_id) {
679  $confirm->addItem(
680  'roles[]',
681  $role_id,
683  );
684  }
685  $this->tpl->setContent($confirm->getHTML());
686  }
static _lookupTitle($a_id)
lookup object title
global $DIC
Definition: goto.php:24
static _getTranslation($a_role_title)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ createObject()

ilObjRoleFolderGUI::createObject ( )

role folders are created automatically DEPRECATED !!! public

Definition at line 733 of file class.ilObjRoleFolderGUI.php.

734  {
735  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
736 
737  /*
738  $this->object->setTitle($this->lng->txt("obj_".$this->object->getType()."_local"));
739  $this->object->setDescription("obj_".$this->object->getType()."_local_desc");
740 
741  $this->saveObject();
742  */
743  }
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ deleteObject()

ilObjRoleFolderGUI::deleteObject (   $a_error = false)

display deletion confirmation screen DEPRECATED !!! public

Definition at line 750 of file class.ilObjRoleFolderGUI.php.

751  {
752  $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
753  }
redirection script todo: (a better solution should control the processing via a xml file) ...

◆ deleteRoleObject()

ilObjRoleFolderGUI::deleteRoleObject ( )
protected

Delete roles.

Definition at line 691 of file class.ilObjRoleFolderGUI.php.

References $_POST, $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$rbacreview, ilObjectGUI\$rbacsystem, and ilObjectFactory\getInstanceByObjId().

692  {
693  global $DIC;
694 
695  $rbacsystem = $DIC['rbacsystem'];
696  $ilErr = $DIC['ilErr'];
697  $rbacreview = $DIC['rbacreview'];
698  $ilCtrl = $DIC['ilCtrl'];
699 
700  if (!$rbacsystem->checkAccess('delete', $this->object->getRefId())) {
701  $ilErr->raiseError(
702  $this->lng->txt('msg_no_perm_delete'),
703  $ilErr->MESSAGE
704  );
705  }
706 
707  foreach ((array) $_POST['roles'] as $id) {
708  // instatiate correct object class (role or rolt)
709  $obj = ilObjectFactory::getInstanceByObjId($id, false);
710 
711  if ($obj->getType() == "role") {
712  $rolf_arr = $rbacreview->getFoldersAssignedToRole($obj->getId(), true);
713  $obj->setParent($rolf_arr[0]);
714  }
715 
716  $obj->delete();
717  }
718 
719  // set correct return location if rolefolder is removed
720  ilUtil::sendSuccess($this->lng->txt("msg_deleted_roles_rolts"), true);
721  $ilCtrl->redirect($this, 'view');
722  }
global $DIC
Definition: goto.php:24
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$_POST["username"]
+ Here is the call graph for this function:

◆ doAddRolePermissions()

ilObjRoleFolderGUI::doAddRolePermissions (   $source,
  $target 
)
protected

do add role permission

Definition at line 489 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjectGUI\$rbacreview, and $source.

Referenced by adjustRoleObject().

490  {
491  global $DIC;
492 
493  $rbacadmin = $DIC->rbac()->admin();
494  $rbacreview = $DIC->rbac()->review();
495 
496  $source_definition = $rbacreview->getRoleFolderOfRole($source);
497  $rbacadmin->copyRolePermissionUnion(
498  $source,
499  $source_definition,
500  $target,
501  $rbacreview->getRoleFolderOfRole($target),
502  $target,
503  $rbacreview->getRoleFolderOfRole($target)
504  );
505  }
global $DIC
Definition: goto.php:24
$source
Definition: metadata.php:76
+ Here is the caller graph for this function:

◆ doChangeExistingObjects()

ilObjRoleFolderGUI::doChangeExistingObjects (   $a_start_obj,
  $a_target_role,
  $a_operation_mode,
  $a_source_role 
)
protected

Do change existing objects.

Definition at line 582 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjRole\MODE_PROTECTED_KEEP_LOCAL_POLICIES, ilObjRole\MODE_READ_OPERATIONS, ilObjRole\MODE_UNPROTECTED_KEEP_LOCAL_POLICIES, and ilLogLevel\WARNING.

Referenced by adjustRoleObject().

583  {
584  global $DIC;
585 
586  $review = $DIC->rbac()->review();
587 
588  if (!$a_start_obj) {
589  $this->logger->warning('Missing parameter start object.');
590  $this->logger->logStack(\ilLogLevel::WARNING);
591  throw new InvalidArgumentException('Missing parameter: start object');
592  }
593  // the mode is unchanged and read out from the target object
594  $target_ref_id = $review->getRoleFolderOfRole($a_target_role);
595  if ($review->isProtected($target_ref_id, $a_target_role)) {
597  }
598  else {
600  }
601  if ($a_start_obj) {
602  $operation_stack = [];
603  if ($a_operation_mode !== \ilObjRole::MODE_READ_OPERATIONS) {
604  $operation_stack[] = $review->getAllOperationsOfRole($a_source_role, $this->ref_id);
605  }
606 
607  $this->logger->debug('Current operation stack');
608  $this->logger->dump($operation_stack);
609 
610  $role = new ilObjRole($a_target_role);
611  $role->changeExistingObjects(
612  $a_start_obj,
613  $mode,
614  array('all'),
615  [],
616  $a_operation_mode,
617  $operation_stack
618  );
619  }
620  }
Class ilObjRole.
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
const MODE_READ_OPERATIONS
global $DIC
Definition: goto.php:24
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
+ Here is the caller graph for this function:

◆ doCopyRole()

ilObjRoleFolderGUI::doCopyRole (   $source,
  $target 
)
protected

Perform copy of role.

Definition at line 561 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjectGUI\$rbacreview, and $source.

Referenced by adjustRoleObject().

562  {
563  global $DIC;
564 
565  $rbacadmin = $DIC->rbac()->admin();
566  $rbacreview = $DIC->rbac()->review();
567 
568  $target_obj = $rbacreview->getRoleFolderOfRole($target);
569  $source_obj = $rbacreview->getRoleFolderOfRole($source);
570  // Copy role template permissions
571  $rbacadmin->copyRoleTemplatePermissions(
572  $source,
573  $source_obj,
574  $target_obj,
575  $target
576  );
577  }
global $DIC
Definition: goto.php:24
$source
Definition: metadata.php:76
+ Here is the caller graph for this function:

◆ doRemoveRolePermissions()

ilObjRoleFolderGUI::doRemoveRolePermissions (   $source,
  $target 
)
protected

do add role permission

Definition at line 536 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjectGUI\$rbacreview, $source, and ilLoggerFactory\getLogger().

Referenced by adjustRoleObject(), and removeRolePermissionsObject().

537  {
538  global $DIC;
539 
540  $rbacadmin = $DIC->rbac()->admin();
541  $rbacreview = $DIC->rbac()->review();
542 
543  ilLoggerFactory::getLogger('ac')->debug('Remove permission source: ' . $source);
544  ilLoggerFactory::getLogger('ac')->debug('Remove permission target: ' . $target);
545 
546  $source_obj = $rbacreview->getRoleFolderOfRole($source);
547  $rbacadmin->copyRolePermissionSubtract(
548  $source,
549  $source_obj,
550  $target,
551  $rbacreview->getRoleFolderOfRole($target)
552  );
553 
554  }
global $DIC
Definition: goto.php:24
static getLogger($a_component_id)
Get component logger.
$source
Definition: metadata.php:76
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettingsObject()

ilObjRoleFolderGUI::editSettingsObject ( ilPropertyFormGUI  $a_form = null)

Definition at line 880 of file class.ilObjRoleFolderGUI.php.

References initSettingsForm().

Referenced by saveSettingsObject().

881  {
882  if (!$a_form) {
883  $a_form = $this->initSettingsForm();
884  }
885 
886  $this->tpl->setContent($a_form->getHTML());
887  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjRoleFolderGUI::executeCommand ( )

Definition at line 74 of file class.ilObjRoleFolderGUI.php.

References $DIC, $ret, and ilObjectGUI\prepareOutput().

75  {
76  global $DIC;
77 
78  $ilTabs = $DIC['ilTabs'];
79 
80  $next_class = $this->ctrl->getNextClass($this);
81  $cmd = $this->ctrl->getCmd();
82  $this->prepareOutput();
83 
84  switch ($next_class) {
85 
86  case 'ilpermissiongui':
87  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
88  $perm_gui = new ilPermissionGUI($this);
89  $ret = &$this->ctrl->forwardCommand($perm_gui);
90  break;
91 
92  default:
93  $this->ctrl->setReturn($this, "view");
94  if (!$cmd) {
95  $cmd = "view";
96  }
97  $cmd .= "Object";
98  $this->$cmd();
99 
100  break;
101  }
102  return true;
103  }
prepareOutput($a_show_subobjects=true)
prepare output
global $DIC
Definition: goto.php:24
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjRoleFolderGUI::getAdminTabs ( )

Add role folder tabs ilTree $tree ilLanguage $lng.

Parameters
ilTabsGUI$tabs_gui

Definition at line 849 of file class.ilObjRoleFolderGUI.php.

References ilObjectGUI\checkPermissionBool().

850  {
851  if ($this->checkPermissionBool("visible,read")) {
852  $this->tabs_gui->addTarget(
853  "view",
854  $this->ctrl->getLinkTarget($this, "view"),
855  array("", "view"),
856  get_class($this)
857  );
858 
859  $this->tabs_gui->addTarget(
860  "settings",
861  $this->ctrl->getLinkTarget($this, "editSettings"),
862  array("editSettings"),
863  get_class($this)
864  );
865  }
866 
867  if ($this->checkPermissionBool("edit_permission")) {
868  $this->tabs_gui->addTarget(
869  "perm_settings",
870  $this->ctrl->getLinkTargetByClass(
871  array(get_class($this),'ilpermissiongui'),
872  "perm"
873  ),
874  "",
875  "ilpermissiongui"
876  );
877  }
878  }
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ initCopyBehaviourForm()

ilObjRoleFolderGUI::initCopyBehaviourForm ( int  $copy_source)
protected

Show copy behaviour form.

Definition at line 299 of file class.ilObjRoleFolderGUI.php.

References $_POST.

Referenced by adjustRoleObject(), chooseCopyBehaviourObject(), and removeRolePermissionsObject().

300  {
301  // not only for role templates; add/remove permissions is also applicable for roles
302  $full_featured = true;
303 
304  $form = new ilPropertyFormGUI();
305  $form->setTitle($this->lng->txt('rbac_copy_behaviour'));
306  $form->setFormAction($this->ctrl->getFormAction($this, 'chooseCopyBehaviour'));
307 
308  $copy_type = new \ilRadioGroupInputGUI(
309  $this->lng->txt('rbac_form_copy_roles_adjust_type'),
310  'type'
311  );
312  $copy_type->setRequired(true);
313  $copy_type->setValue(self::COPY_CLONE_PERMISSIONS);
314 
315  if ($full_featured) {
316  $add = new \ilRadioOption(
317  $this->lng->txt('rbac_form_copy_roles_adjust_type_add'),
318  self::COPY_ADD_PERMISSIONS,
319  $this->lng->txt('rbac_form_copy_roles_adjust_type_add_info')
320  );
321  $copy_type->addOption($add);
322 
323  $ce_type_add = new \ilRadioGroupInputGUI(
324  '',
325  'add_ce_type'
326  );
327  $ce_type_add->setRequired(true);
328  $ce_add_yes = new \ilRadioOption(
329  $this->lng->txt('rbac_form_copy_roles_ce_add_yes'),
330  self::COPY_CHANGE_EXISTING_OBJECTS,
331  $this->lng->txt('rbac_form_copy_roles_ce_add_yes_info')
332  );
333  $ce_type_add->addOption($ce_add_yes);
334  $ce_add_no = new \ilRadioOption(
335  $this->lng->txt('rbac_form_copy_roles_ce_add_no'),
336  0,
337  $this->lng->txt('rbac_form_copy_roles_ce_add_no_info')
338  );
339  $ce_type_add->addOption($ce_add_no);
340  $add->addSubItem($ce_type_add);
341  }
342  $clone = new \ilRadioOption(
343  $this->lng->txt('rbac_form_copy_roles_adjust_type_clone'),
344  self::COPY_CLONE_PERMISSIONS,
345  $this->lng->txt('rbac_form_copy_roles_adjust_type_clone_info')
346  );
347  $copy_type->addOption($clone);
348 
349 
350  $ce_type_clone = new \ilRadioGroupInputGUI(
351  '',
352  'clone_ce_type'
353  );
354  $ce_type_clone->setRequired(true);
355  $ce_clone_yes = new \ilRadioOption(
356  $this->lng->txt('rbac_form_copy_roles_ce_clone_yes'),
357  self::COPY_CHANGE_EXISTING_OBJECTS,
358  $this->lng->txt('rbac_form_copy_roles_ce_clone_yes_info')
359  );
360  $ce_type_clone->addOption($ce_clone_yes);
361  $ce_clone_no = new \ilRadioOption(
362  $this->lng->txt('rbac_form_copy_roles_ce_clone_no'),
363  0,
364  $this->lng->txt('rbac_form_copy_roles_ce_clone_no_info')
365  );
366  $ce_type_clone->addOption($ce_clone_no);
367  $clone->addSubItem($ce_type_clone);
368 
369  if ($full_featured) {
370  $remove = new \ilRadioOption(
371  $this->lng->txt('rbac_form_copy_roles_adjust_type_remove'),
372  self::COPY_REMOVE_PERMISSIONS,
373  $this->lng->txt('rbac_form_copy_roles_adjust_type_remove_info')
374  );
375  $copy_type->addOption($remove);
376  $ce_type_remove = new \ilRadioGroupInputGUI(
377  '',
378  'remove_ce_type'
379  );
380  $ce_type_remove->setRequired(true);
381  $ce_remove_yes = new \ilRadioOption(
382  $this->lng->txt('rbac_form_copy_roles_ce_remove_yes'),
383  self::COPY_CHANGE_EXISTING_OBJECTS,
384  $this->lng->txt('rbac_form_copy_roles_ce_remove_yes_info')
385  );
386  $ce_type_remove->addOption($ce_remove_yes);
387  $ce_remove_no = new \ilRadioOption(
388  $this->lng->txt('rbac_form_copy_roles_ce_remove_no'),
389  0,
390  $this->lng->txt('rbac_form_copy_roles_ce_remove_no_info')
391  );
392  $ce_type_remove->addOption($ce_remove_no);
393  $remove->addSubItem($ce_type_remove);
394  }
395 
396  $form->addItem($copy_type);
397 
398  $roles = new ilHiddenInputGUI('roles');
399  $roles->setValue(implode(',', (array) $_POST['roles']));
400  $form->addItem($roles);
401 
402  $form->addCommandButton('roleSearchList', $this->lng->txt('back'));
403  $form->addCommandButton('adjustRole',$this->lng->txt('rbac_form_copy_roles_adjust_button'));
404  return $form;
405  }
This class represents a property form user interface.
This class represents a hidden form property in a property form.
$_POST["username"]
+ Here is the caller graph for this function:

◆ initRoleSearchForm()

ilObjRoleFolderGUI::initRoleSearchForm ( )
protected

Init role search form.

Definition at line 194 of file class.ilObjRoleFolderGUI.php.

References $DIC.

Referenced by roleSearchFormObject(), and roleSearchObject().

195  {
196  global $DIC;
197 
198  $ilCtrl = $DIC['ilCtrl'];
199 
200  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
201  $form = new ilPropertyFormGUI();
202  $form->setTitle($this->lng->txt('rbac_role_title'));
203  $form->setFormAction($ilCtrl->getFormAction($this, 'view'));
204 
205  $search = new ilTextInputGUI($this->lng->txt('title'), 'title');
206  $search->setRequired(true);
207  $search->setSize(30);
208  $search->setMaxLength(255);
209  $form->addItem($search);
210 
211  $form->addCommandButton('roleSearchForm', $this->lng->txt('search'));
212  return $form;
213  }
This class represents a property form user interface.
global $DIC
Definition: goto.php:24
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilObjRoleFolderGUI::initSettingsForm ( )
protected

Definition at line 924 of file class.ilObjRoleFolderGUI.php.

References $DIC, $GLOBALS, $ilUser, ilObjectGUI\$rbacreview, ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilFormPropertyGUI\setInfo(), and SYSTEM_ROLE_ID.

Referenced by editSettingsObject(), and saveSettingsObject().

925  {
926  global $DIC;
927 
928  $rbacreview = $DIC['rbacreview'];
929  $ilUser = $DIC['ilUser'];
930 
931  $this->lng->loadLanguageModule('ps');
932 
933  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
934  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
935  $privacy = ilPrivacySettings::_getInstance();
936  $security = ilSecuritySettings::_getInstance();
937 
938  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
939  $form = new ilPropertyFormGUI();
940  $form->setFormAction($this->ctrl->getFormAction($this, "saveSettings"));
941  $form->setTitle($this->lng->txt('settings'));
942 
943  // protected admin
944  $admin = new ilCheckboxInputGUI($GLOBALS['DIC']['lng']->txt('adm_adm_role_protect'), 'admin_role');
945  $admin->setDisabled(!$rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID));
946  $admin->setInfo($this->lng->txt('adm_adm_role_protect_info'));
947  $admin->setChecked((int) $security->isAdminRoleProtected());
948  $admin->setValue(1);
949  $form->addItem($admin);
950 
951  $check = new ilCheckboxInputGui($this->lng->txt('rbac_log'), 'rbac_log');
952  $check->setInfo($this->lng->txt('rbac_log_info'));
953  $check->setChecked($privacy->enabledRbacLog());
954  $form->addItem($check);
955 
956  $age = new ilNumberInputGUI($this->lng->txt('rbac_log_age'), 'rbac_log_age');
957  $age->setInfo($this->lng->txt('rbac_log_age_info'));
958  $age->setValue($privacy->getRbacLogAge());
959  $age->setMinValue(1);
960  $age->setMaxValue(24);
961  $age->setSize(2);
962  $age->setMaxLength(2);
963  $check->addSubItem($age);
964 
965  $form->addCommandButton('saveSettings', $this->lng->txt('save'));
966 
967  return $form;
968  }
This class represents a property form user interface.
const SYSTEM_ROLE_ID
Definition: constants.php:27
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static _getInstance()
Get instance of ilPrivacySettings.
$ilUser
Definition: imgupload.php:18
static _getInstance()
Get instance of ilSecuritySettings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeRolePermissionsObject()

ilObjRoleFolderGUI::removeRolePermissionsObject ( )
protected

Remove role permissions.

Definition at line 510 of file class.ilObjRoleFolderGUI.php.

References $_POST, $DIC, $source, doRemoveRolePermissions(), and initCopyBehaviourForm().

511  {
512  global $DIC;
513 
514  $ilCtrl = $DIC['ilCtrl'];
515 
516  // Finally copy role/rolt
517  $roles = explode(',', $_POST['roles']);
518  $source = (int) $_REQUEST['csource'];
519 
520  $form = $this->initCopyBehaviourForm();
521  if ($form->checkInput()) {
522  foreach ((array) $roles as $role_id) {
523  if ($role_id != $source) {
524  $this->doRemoveRolePermissions($source, $role_id, $form->getInput('change_existing'));
525  }
526  }
527 
528  ilUtil::sendSuccess($this->lng->txt('rbac_copy_finished'), true);
529  $ilCtrl->redirect($this, 'view');
530  }
531  }
initCopyBehaviourForm(int $copy_source)
Show copy behaviour form.
global $DIC
Definition: goto.php:24
doRemoveRolePermissions($source, $target)
do add role permission
$source
Definition: metadata.php:76
$_POST["username"]
+ Here is the call graph for this function:

◆ resetFilterObject()

ilObjRoleFolderGUI::resetFilterObject ( )

Reset role filter.

Definition at line 640 of file class.ilObjRoleFolderGUI.php.

References viewObject().

641  {
642  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
643  $table = new ilRoleTableGUI($this, 'view');
644  $table->init();
645  $table->resetOffset();
646  $table->resetFilter();
647 
648  $this->viewObject();
649  }
TableGUI for the presentation og roles and role templates.
viewObject()
ilErrorHandler $ilErr ilRbacSystem $rbacsystem ilToolbarGUI $ilToolbar
+ Here is the call graph for this function:

◆ roleSearchFormObject()

ilObjRoleFolderGUI::roleSearchFormObject ( )
protected

Parse search query $ilCtrl.

Definition at line 220 of file class.ilObjRoleFolderGUI.php.

References $_SESSION, $DIC, initRoleSearchForm(), roleSearchListObject(), and ilUtil\sendFailure().

221  {
222  global $DIC;
223 
224  $ilCtrl = $DIC['ilCtrl'];
225 
226  $_SESSION['rolf_search_query'] = '';
227  $ilCtrl->setParameter($this, 'csource', (int) $_REQUEST['csource']);
228 
229  $form = $this->initRoleSearchForm();
230  if ($form->checkInput()) {
231  $_SESSION['rolf_search_query'] = $form->getInput('title');
232  return $this->roleSearchListObject();
233  }
234 
235  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
236  $form->setValuesByPost();
237  $ilCtrl->redirect($this, 'roleSearch');
238  }
$_SESSION["AccountId"]
global $DIC
Definition: goto.php:24
initRoleSearchForm()
Init role search form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ roleSearchListObject()

ilObjRoleFolderGUI::roleSearchListObject ( )
protected

List roles.

Definition at line 243 of file class.ilObjRoleFolderGUI.php.

References $_SESSION, $DIC, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilRoleTableGUI\TYPE_SEARCH.

Referenced by roleSearchFormObject().

244  {
245  global $DIC;
246 
247  $ilTabs = $DIC['ilTabs'];
248  $ilCtrl = $DIC['ilCtrl'];
249 
250  $ilTabs->clearTargets();
251  $ilTabs->setBackTarget(
252  $this->lng->txt('rbac_back_to_overview'),
253  $this->ctrl->getLinkTarget($this, 'view')
254  );
255 
256  $ilCtrl->setParameter($this, 'csource', (int) $_REQUEST['csource']);
257 
258  if (strlen($_SESSION['rolf_search_query'])) {
259  ilUtil::sendInfo($this->lng->txt('rbac_select_copy_targets'));
260 
261  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
262  $table = new ilRoleTableGUI($this, 'roleSearchList');
263  $table->setType(ilRoleTableGUI::TYPE_SEARCH);
264  $table->setRoleTitleFilter($_SESSION['rolf_search_query']);
265  $table->init();
266  $table->parse($this->object->getId());
267  return $this->tpl->setContent($table->getHTML());
268  }
269 
270  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'), true);
271  $ilCtrl->redirect($this, 'roleSearch');
272  }
$_SESSION["AccountId"]
TableGUI for the presentation og roles and role templates.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ roleSearchObject()

ilObjRoleFolderGUI::roleSearchObject ( )
protected

Search target roles.

Definition at line 165 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$rbacsystem, initRoleSearchForm(), and ilUtil\sendInfo().

166  {
167  global $DIC;
168 
169  $rbacsystem = $DIC['rbacsystem'];
170  $ilCtrl = $DIC['ilCtrl'];
171  $ilTabs = $DIC['ilTabs'];
172  $ilErr = $DIC['ilErr'];
173 
174  $ilTabs->clearTargets();
175  $ilTabs->setBackTarget(
176  $this->lng->txt('rbac_back_to_overview'),
177  $this->ctrl->getLinkTarget($this, 'view')
178  );
179 
180  if (!$rbacsystem->checkAccess('visible,read', $this->object->getRefId())) {
181  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
182  }
183 
184  $ilCtrl->setParameter($this, 'csource', (int) $_REQUEST['csource']);
185  ilUtil::sendInfo($this->lng->txt('rbac_choose_copy_targets'));
186 
187  $form = $this->initRoleSearchForm();
188  $this->tpl->setContent($form->getHTML());
189  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
initRoleSearchForm()
Init role search form.
+ Here is the call graph for this function:

◆ saveObject()

ilObjRoleFolderGUI::saveObject ( )

save object public

Definition at line 821 of file class.ilObjRoleFolderGUI.php.

References $_GET, $_POST, and $DIC.

822  {
823  global $DIC;
824 
825  $rbacadmin = $DIC['rbacadmin'];
826 
827  // role folders are created automatically
828  $_GET["new_type"] = $this->object->getType();
829  $_POST["Fobject"]["title"] = $this->object->getTitle();
830  $_POST["Fobject"]["desc"] = $this->object->getDescription();
831 
832  // always call parent method first to create an object_data entry & a reference
833  $newObj = parent::saveObject();
834 
835  // put here your object specific stuff
836 
837  // always send a message
838  ilUtil::sendSuccess($this->lng->txt("rolf_added"), true);
839 
840  $this->ctrl->redirect($this, "view");
841  }
$_GET["client_id"]
global $DIC
Definition: goto.php:24
$_POST["username"]

◆ saveSettingsObject()

ilObjRoleFolderGUI::saveSettingsObject ( )

Definition at line 889 of file class.ilObjRoleFolderGUI.php.

References $_POST, $DIC, ilObjectGUI\$ilErr, $ilUser, ilObjectGUI\$rbacreview, ilPrivacySettings\_getInstance(), ilSecuritySettings\_getInstance(), ilObjectGUI\checkPermissionBool(), editSettingsObject(), initSettingsForm(), and SYSTEM_ROLE_ID.

890  {
891  global $DIC;
892 
893  $ilErr = $DIC['ilErr'];
894  $rbacreview = $DIC['rbacreview'];
895  $ilUser = $DIC['ilUser'];
896 
897  if (!$this->checkPermissionBool("write")) {
898  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
899  }
900 
901  $form = $this->initSettingsForm();
902  if ($form->checkInput()) {
903  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
904  $privacy = ilPrivacySettings::_getInstance();
905  $privacy->enableRbacLog((int) $_POST['rbac_log']);
906  $privacy->setRbacLogAge((int) $_POST['rbac_log_age']);
907  $privacy->save();
908 
909  if ($rbacreview->isAssigned($ilUser->getId(), SYSTEM_ROLE_ID)) {
910  include_once('./Services/PrivacySecurity/classes/class.ilSecuritySettings.php');
911  $security = ilSecuritySettings::_getInstance();
912  $security->protectedAdminRole((int) $_POST['admin_role']);
913  $security->save();
914  }
915 
916  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
917  $this->ctrl->redirect($this, "editSettings");
918  }
919 
920  $form->setValuesByPost();
921  $this->editSettingsObject($form);
922  }
editSettingsObject(ilPropertyFormGUI $a_form=null)
const SYSTEM_ROLE_ID
Definition: constants.php:27
global $DIC
Definition: goto.php:24
static _getInstance()
Get instance of ilPrivacySettings.
$ilUser
Definition: imgupload.php:18
static _getInstance()
Get instance of ilSecuritySettings.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
+ Here is the call graph for this function:

◆ showPossibleSubObjects()

ilObjRoleFolderGUI::showPossibleSubObjects ( )

show possible subobjects (pulldown menu) overwritten to prevent displaying of role templates in local role folders

public

Definition at line 773 of file class.ilObjRoleFolderGUI.php.

References $d, $DIC, $i, ilObjectGUI\$rbacsystem, ilUtil\formSelect(), and ROLE_FOLDER_ID.

774  {
775  global $DIC;
776 
777  $rbacsystem = $DIC['rbacsystem'];
778 
779  $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
780 
781  if ($this->object->getRefId() != ROLE_FOLDER_ID or !$rbacsystem->checkAccess('create_rolt', ROLE_FOLDER_ID)) {
782  unset($d["rolt"]);
783  }
784 
785  if (!$rbacsystem->checkAccess('create_role', $this->object->getRefId())) {
786  unset($d["role"]);
787  }
788 
789  if (count($d) > 0) {
790  foreach ($d as $row) {
791  $count = 0;
792  if ($row["max"] > 0) {
793  //how many elements are present?
794  for ($i = 0; $i < count($this->data["ctrl"]); $i++) {
795  if ($this->data["ctrl"][$i]["type"] == $row["name"]) {
796  $count++;
797  }
798  }
799  }
800  if ($row["max"] == "" || $count < $row["max"]) {
801  $subobj[] = $row["name"];
802  }
803  }
804  }
805 
806  if (is_array($subobj)) {
807  //build form
808  $opts = ilUtil::formSelect(12, "new_type", $subobj);
809  $this->tpl->setCurrentBlock("add_object");
810  $this->tpl->setVariable("SELECT_OBJTYPE", $opts);
811  $this->tpl->setVariable("BTN_NAME", "create");
812  $this->tpl->setVariable("TXT_ADD", $this->lng->txt("add"));
813  $this->tpl->parseCurrentBlock();
814  }
815  }
global $DIC
Definition: goto.php:24
const ROLE_FOLDER_ID
Definition: constants.php:32
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ viewObject()

ilObjRoleFolderGUI::viewObject ( )

ilErrorHandler $ilErr ilRbacSystem $rbacsystem ilToolbarGUI $ilToolbar

Definition at line 111 of file class.ilObjRoleFolderGUI.php.

References $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$rbacreview, and ilObjectGUI\$rbacsystem.

Referenced by applyFilterObject(), and resetFilterObject().

112  {
113  global $DIC;
114 
115  $ilErr = $DIC['ilErr'];
116  $rbacsystem = $DIC['rbacsystem'];
117  $ilToolbar = $DIC['ilToolbar'];
118  $rbacreview = $DIC['rbacreview'];
119  $ilTabs = $DIC['ilTabs'];
120 
121  $ilTabs->activateTab('view');
122 
123  if (!$rbacsystem->checkAccess('visible,read', $this->object->getRefId())) {
124  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->MESSAGE);
125  }
126 
127 
128  if ($rbacsystem->checkAccess('create_role', $this->object->getRefId())) {
129  $this->ctrl->setParameter($this, 'new_type', 'role');
130  $ilToolbar->addButton(
131  $this->lng->txt('rolf_create_role'),
132  $this->ctrl->getLinkTarget($this, 'create')
133  );
134  }
135  if ($rbacsystem->checkAccess('create_rolt', $this->object->getRefId())) {
136  $this->ctrl->setParameter($this, 'new_type', 'rolt');
137  $ilToolbar->addButton(
138  $this->lng->txt('rolf_create_rolt'),
139  $this->ctrl->getLinkTarget($this, 'create')
140  );
141  $this->ctrl->clearParameters($this);
142  }
143 
144  if (
145  $rbacsystem->checkAccess('create_rolt', $this->object->getRefId()) ||
146  $rbacsystem->checkAccess('create_rolt', $this->object->getRefId())
147  ) {
148  $ilToolbar->addButton(
149  $this->lng->txt('rbac_import_role'),
150  $this->ctrl->getLinkTargetByClass('ilPermissionGUI', 'displayImportRoleForm')
151  );
152  }
153 
154  include_once './Services/AccessControl/classes/class.ilRoleTableGUI.php';
155  $table = new ilRoleTableGUI($this, 'view');
156  $table->init();
157  $table->parse($this->object->getId());
158 
159  $this->tpl->setContent($table->getHTML());
160  }
TableGUI for the presentation og roles and role templates.
global $DIC
Definition: goto.php:24
+ Here is the caller graph for this function:

Field Documentation

◆ $logger

ilObjRoleFolderGUI::$logger = null
private

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

◆ $type

ilObjRoleFolderGUI::$type

Definition at line 56 of file class.ilObjRoleFolderGUI.php.

◆ COPY_ADD_PERMISSIONS

const ilObjRoleFolderGUI::COPY_ADD_PERMISSIONS = 1
private

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

◆ COPY_CHANGE_EXISTING_OBJECTS

const ilObjRoleFolderGUI::COPY_CHANGE_EXISTING_OBJECTS = 1
private

Definition at line 43 of file class.ilObjRoleFolderGUI.php.

◆ COPY_CLONE_PERMISSIONS

const ilObjRoleFolderGUI::COPY_CLONE_PERMISSIONS = 2
private

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

◆ COPY_REMOVE_PERMISSIONS

const ilObjRoleFolderGUI::COPY_REMOVE_PERMISSIONS = 3
private

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


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