private function isAccessDenied()
 {
     if (!$this->poolOBJ->isSkillServiceEnabled()) {
         return true;
     }
     if (!ilObjQuestionPool::isSkillManagementGloballyActivated()) {
         return true;
     }
     if (!$this->access->checkAccess('write', '', $this->refId)) {
         return true;
     }
     return false;
 }
 function __showRolesTable($a_result_set, $a_from = "")
 {
     if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this, "");
     }
     $tbl =& $this->parent_gui->__initTableGUI();
     $tpl =& $tbl->getTemplateObject();
     // SET FORMAACTION
     $tpl->setCurrentBlock("tbl_form_header");
     $this->ctrl->setParameter($this, 'obj_id', $_GET['obj_id']);
     $tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
     $tpl->parseCurrentBlock();
     // SET FOOTER BUTTONS
     $tpl->setVariable("COLUMN_COUNTS", 4);
     $tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.svg"));
     $tpl->setCurrentBlock("tbl_action_button");
     $tpl->setVariable("BTN_NAME", "assignSave");
     $tpl->setVariable("BTN_VALUE", $this->lng->txt("change_assignment"));
     $tpl->parseCurrentBlock();
     $tpl->setCurrentBlock("tbl_action_row");
     $tpl->setVariable("TPLPATH", $this->tpl->tplPath);
     $tpl->parseCurrentBlock();
     $tmp_obj =& ilObjectFactory::getInstanceByObjId($_GET['obj_id']);
     $title = $this->lng->txt('role_assignment') . ' (' . $tmp_obj->getFullname() . ')';
     $tbl->setTitle($title, "icon_role.svg", $this->lng->txt("role_assignment"));
     $tbl->setHeaderNames(array('', $this->lng->txt("title"), $this->lng->txt('description'), $this->lng->txt("type")));
     $tbl->setHeaderVars(array("", "title", "description", "type"), array("ref_id" => $this->object->getRefId(), "cmd" => "assignRoles", "obj_id" => $_GET['obj_id'], "cmdClass" => "ilobjcategorygui", "cmdNode" => $_GET["cmdNode"]));
     $tbl->setColumnWidth(array("4%", "35%", "45%", "16%"));
     $this->set_unlimited = true;
     $this->parent_gui->__setTableGUIBasicData($tbl, $a_result_set, $a_from, true);
     $tbl->render();
     $this->tpl->setVariable("ROLES_TABLE", $tbl->tpl->get());
     return true;
 }
 /**
  * Check if user can edit types
  */
 protected function checkAccess()
 {
     if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this->parent_gui);
     }
 }
 /**
  * Builds tabs and subtabs using given $tabs, $config and $command
  * parameters.
  * @param ilTabsGUI $tabs
  * @param array     $config
  * @param array     $command
  */
 private function buildTabs(ilTabsGUI $tabs, $config, $command)
 {
     require_once 'Modules/Chatroom/classes/class.ilChatroom.php';
     foreach ($config as $id => $tabDefinition) {
         if (!ilChatroom::checkUserPermissions($tabDefinition['permission'], $this->gui->getRefId(), false)) {
             continue;
         } else {
             if (isset($tabDefinition['enabled']) && !$tabDefinition['enabled']) {
                 continue;
             }
         }
         $tabs->addTab($id, $this->getLabel($tabDefinition, $id), $tabDefinition['link']);
         if ($command[0] == $id && isset($tabDefinition['subtabs']) && is_array($tabDefinition['subtabs'])) {
             foreach ($tabDefinition['subtabs'] as $subid => $subTabDefinition) {
                 if (!$this->access->checkAccess($subTabDefinition['permission'], '', $this->gui->getRefId())) {
                     continue;
                 } else {
                     if (isset($subTabDefinition['enabled']) && !$subTabDefinition['enabled']) {
                         continue;
                     }
                 }
                 $tabs->addSubTab($subid, $this->getLabel($subTabDefinition, $subid), $subTabDefinition['link']);
             }
         }
     }
 }
 /**
  * Check permission of user
  * Redirect to course if permission check fails
  *
  */
 protected function checkPermission()
 {
     if (!$this->access->checkAccess('write', '', $this->ref_id)) {
         $this->ctrl->setParameterByClass('ilrepositorygui', 'ref_id', $this->ref_id);
         ilUtil::sendFailure($this->pl->txt('msg_no_permission_certificates'), true);
         $this->ctrl->redirectByClass('ilrepositorygui');
     }
 }
 public function setTabs()
 {
     $this->tabs_gui->addSubTab("show_staff", sprintf($this->lng->txt("local_staff"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showStaff"));
     if ($this->ilAccess->checkAccess("view_learning_progress_rec", "", $this->parent_object->getRefId())) {
         $this->tabs_gui->addSubTab("show_staff_rec", sprintf($this->lng->txt("rec_staff"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showStaffRec"));
     }
     if ($this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
         $this->tabs_gui->addSubTab("show_other_roles", sprintf($this->lng->txt("local_other_roles"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showOtherRoles"));
     }
 }
 /**
  * @param $a_comp
  * @param $a_part
  * @param array $a_par
  */
 public function modifyGUI($a_comp, $a_part, $a_par = array())
 {
     /**
      * @var $ilTabsGUI ilTabsGUI
      */
     if ($a_part == 'tabs' && isset($_GET['ref_id']) && self::$ref_is_crs !== false) {
         // ATM only display certificate tab in courses
         if (self::$ref_is_crs === null && ilObject::_lookupType((int) $_GET['ref_id'], true) != 'crs' || $_GET['admin_mode']) {
             self::$ref_is_crs = false;
             return;
         }
         self::$ref_is_crs = true;
         // User needs write access to course to see the tab 'certificate'
         if ($this->access->checkAccess('write', '', (int) $_GET['ref_id'])) {
             $ilTabsGUI = $a_par['tabs'];
             $this->ctrl->setParameterByClass('srCertificateDefinitionGUI', 'ref_id', $_GET['ref_id']);
             $link = $this->ctrl->getLinkTargetByClass(array(ilCertificatePlugin::getBaseClass(), 'srCertificateDefinitionGUI'));
             $ilTabsGUI->addTarget('certificate', $link, 'show', 'srCertificateDefinitionGUI');
         }
     }
 }
 public function updateSettings()
 {
     if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this);
     }
     $form = new ilObjOrgUnitSettingsFormGUI($this, $this->object);
     if ($form->saveObject()) {
         ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
         $this->ctrl->redirect($this, 'editSettings');
     } else {
         $this->tpl->setContent($form->getHTML());
     }
 }
 public function setTabs()
 {
     if ($this->access->checkAccess('read', '', $this->object->getRefId())) {
         $this->tabs->addTab('edit', $this->txt('pad'), $this->ctrl->getLinkTarget($this, 'editContent'));
     }
     $this->addInfoTab();
     if ($this->access->checkAccess('read', '', $this->object->getRefId())) {
         $this->tabs->addTab('timeslider', $this->txt('timeslider'), $this->ctrl->getLinkTarget($this, 'timeSlider'));
     }
     if ($this->access->checkAccess('write', '', $this->object->getRefId())) {
         $this->tabs->addTab('properties', $this->txt('properties'), $this->ctrl->getLinkTarget($this, 'editProperties'));
     }
     $this->addPermissionTab();
 }
 private function isSyncOriginalPossibleAndAllowed($questionId)
 {
     $questionData = $this->questionList->getDataArrayForQuestionId($questionId);
     if (!$questionData['original_id']) {
         return false;
     }
     require_once 'Modules/TestQuestionPool/classes/class.assQuestion.php';
     $parentObjId = assQuestion::lookupParentObjId($questionData['original_id']);
     if (!$this->doesObjectTypeMatch($parentObjId)) {
         return false;
     }
     foreach (ilObject::_getAllReferences($parentObjId) as $parentRefId) {
         if ($this->access->checkAccess('write', '', $parentRefId)) {
             return true;
         }
     }
     return false;
 }
 /**
  * @param $a_set
  */
 protected function addActionsToRow($a_set)
 {
     if ($this->getActions()) {
         $alist = new ilAdvancedSelectionListGUI();
         $alist->setId(self::domid_encode($a_set[$this->getFields()->getPrimaryField()->getName()]));
         $alist->setListTitle($this->txt('actions', false));
         foreach ($this->getActionsAsArray() as $action) {
             /**
              * @var arIndexTableAction $action
              */
             $access = true;
             if ($action->getAccess()) {
                 $access = $this->access->checkAccess($action->getAccess(), '', $_GET['ref_id']);
             }
             if ($access) {
                 $alist->addItem($action->getTitle(), $action->getId(), $this->ctrl->getLinkTargetByClass($action->getTargetClass(), $action->getTargetCmd()));
             }
         }
         $this->tpl->setVariable('ACTION', $alist->getHTML());
     }
 }
 public function getTabs(&$tabs_gui)
 {
     if ($this->ilAccess->checkAccess('read', '', $this->object->getRefId())) {
         $this->tabs_gui->addTab("view_content", $this->lng->txt("content"), $this->ctrl->getLinkTarget($this, ""));
         $this->tabs_gui->addTab("info_short", "Info", $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
     }
     //Tabs for OrgUnits exclusive root!
     if ($this->object->getRefId() != ilObjOrgUnit::getRootOrgRefId()) {
         if (ilObjOrgUnitAccess::_checkAccessStaff($this->object->getRefId())) {
             $this->tabs_gui->addTab("orgu_staff", $this->lng->txt("orgu_staff"), $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "showStaff"));
         }
         if ($this->ilAccess->checkAccess('write', '', $this->object->getRefId())) {
             $this->tabs_gui->addTab("settings", $this->lng->txt("settings"), $this->ctrl->getLinkTargetByClass("ilTranslationGUI", "editTranslations"));
         }
         if (ilObjOrgUnitAccess::_checkAccessAdministrateUsers($this->object->getRefId())) {
             $this->tabs_gui->addTab("administrate_users", $this->lng->txt("administrate_users"), $this->ctrl->getLinkTargetByClass("ilLocalUserGUI", "index"));
         }
     }
     if ($this->ilAccess->checkAccess('write', '', $this->object->getRefId())) {
         $this->tabs_gui->addTarget('export', $this->ctrl->getLinkTargetByClass('ilorgunitexportgui', ''), 'export', 'ilorgunitexportgui');
     }
     parent::getTabs($tabs_gui);
 }