4include_once 
'./Services/AccessControl/classes/class.ilPermission2GUI.php';
 
   30                parent::__construct($a_gui_obj);
 
   39                global $rbacsystem, 
$ilErr;
 
   42                if (!$rbacsystem->checkAccess(
"edit_permission",$this->gui_obj->object->getRefId()))
 
   44                        $ilErr->raiseError($this->lng->txt(
"permission_denied"),
$ilErr->MESSAGE);
 
   47                $next_class = $this->ctrl->getNextClass($this);
 
   52                                $this->ctrl->setReturn($this,
'perm');
 
   53                                include_once(
"Services/AccessControl/classes/class.ilObjRoleGUI.php");
 
   55                                $this->gui_obj->setBackTarget($this->lng->txt(
"perm_settings"),$this->ctrl->getLinkTarget($this, 
"perm"));
 
   56                                $ret = $this->ctrl->forwardCommand($this->gui_obj);
 
   59                        case 'ildidactictemplategui':
 
   60                                $this->ctrl->setReturn($this,
'perm');
 
   61                                include_once 
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
 
   63                                $this->ctrl->forwardCommand($did);
 
   66                        case 'ilrepositorysearchgui':
 
   68                                include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
 
   70                                $this->ctrl->forwardCommand($rep_search);
 
   73                        case 'ilobjectpermissionstatusgui':
 
   75                                include_once(
'./Services/AccessControl/classes/class.ilObjectPermissionStatusGUI.php');
 
   77                                $this->ctrl->forwardCommand($perm_stat);
 
   81                                $cmd = $this->ctrl->getCmd();
 
   96                return $this->gui_obj->object;
 
  104                include_once 
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
 
  105                $this->ctrl->setReturn($this,
'perm');
 
  106                $this->ctrl->setCmdClass(
'ildidactictemplategui');
 
  108                $this->ctrl->forwardCommand($dtpl_gui,
'confirmTemplateSwitch');
 
  118                global $objDefinition, $ilToolbar;
 
  120                include_once 
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
 
  122                if($dtpl->appendToolbarSwitch(
 
  124                        $this->getCurrentObject()->getType(),
 
  125                        $this->getCurrentObject()->getRefId()
 
  128                        $ilToolbar->addSeparator();
 
  131                if($objDefinition->hasLocalRoles($this->getCurrentObject()->getType()) and
 
  132                        !$this->isAdministrationObject()
 
  135                        $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
 
  139                                $ilToolbar->addButton($this->lng->txt(
'rbac_add_new_local_role'),$this->ctrl->getLinkTarget($this,
'displayAddRoleForm'));
 
  141                        $ilToolbar->addButton($this->lng->txt(
'rbac_import_role'),$this->ctrl->getLinkTarget($this,
'displayImportRoleForm'));
 
  148                        include_once 
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
 
  152                $this->tpl->setContent($table->getHTML());
 
  187                include_once 
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
 
  189                $table->resetOffset();
 
  190                $table->writeFilterToSession();
 
  191                return $this->
perm($table);
 
  200                include_once 
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
 
  202                $table->resetOffset();
 
  203                $table->resetFilter();
 
  205                return $this->
perm($table);
 
  218                if(isset($a_roles[SYSTEM_ROLE_ID]))
 
  220                        unset($a_roles[SYSTEM_ROLE_ID]);
 
  223                switch ($a_filter_id)
 
  233                                $arr_global_roles = $rbacreview->getGlobalRoles();
 
  234                                $arr_remove_roles = array_diff(array_keys($a_roles),$arr_global_roles);
 
  236                                foreach ($arr_remove_roles as $role_id)
 
  238                                        unset($a_roles[$role_id]);
 
  244                                $arr_global_roles = $rbacreview->getGlobalRoles();
 
  246                                foreach ($arr_global_roles as $role_id)
 
  248                                        unset($a_roles[$role_id]);
 
  258                                $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);
 
  260                                foreach ($arr_remove_roles as $role_id)
 
  262                                        unset($a_roles[$role_id]);
 
  271                                $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);
 
  273                                foreach ($arr_remove_roles as $role_id)
 
  275                                        unset($a_roles[$role_id]);
 
  291                global $rbacreview,$objDefinition,$rbacadmin;
 
  293                include_once 
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
 
  297                        $rbacreview->getParentRoleIds($this->getCurrentObject()->getRefId()),
 
  298                        $table->getFilterItemByPostVar(
'role')->getValue()
 
  302                include_once 
"Services/AccessControl/classes/class.ilRbacLog.php";
 
  306                # all possible create permissions  
  307                $possible_ops_ids = $rbacreview->getOperationsByTypeAndClass(
 
  312                # createable (activated) create permissions 
  313                $create_types = $objDefinition->getCreatableSubObjects(
 
  318                foreach((array) $roles as $role => $role_data)
 
  320                        if($role_data[
'protected'])
 
  325                        $new_ops = array_keys((array) 
$_POST[
'perm'][$role]);
 
  326                        $old_ops = $rbacreview->getRoleOperationsOnObject(
 
  332                        foreach($possible_ops_ids as $create_ops_id)
 
  334                                if(in_array($create_ops_id,$createable_ops_ids))
 
  338                                if(in_array($create_ops_id,$old_ops))
 
  340                                        $new_ops[] = $create_ops_id;
 
  344                        $rbacadmin->revokePermission(
 
  349                        $rbacadmin->grantPermission(
 
  351                                array_unique($new_ops),
 
  358                        foreach($roles as $role)
 
  361                                if($role[
'parent'] == $this->
getCurrentObject()->getRefId() and $role[
'assign'] == 
'y')
 
  366                                if($role[
'protected'])
 
  373                                        !isset(
$_POST[
'inherit'][$role[
'obj_id']]) and
 
  374                                        !$rbacreview->isBlockedAtPosition($role[
'obj_id'], $this->getCurrentObject()->getRefId())
 
  384                                if($role[
'parent'] != $this->
getCurrentObject()->getRefId() and isset(
$_POST[
'inherit'][$role[
'obj_id']]))
 
  387                                        $rbacadmin->copyRoleTemplatePermissions(
 
  394                                        $rbacadmin->assignRoleToFolder($role[
'obj_id'],$this->
getCurrentObject()->getRefId(),
'n');
 
  402                        foreach($roles as $role)
 
  404                                if($rbacreview->isAssignable($role[
'obj_id'], $this->getCurrentObject()->getRefId()))
 
  406                                        if(isset(
$_POST[
'protect'][$role[
'obj_id']]) and 
 
  407                                                !$rbacreview->isProtected($this->getCurrentObject()->getRefId(), $role[
'obj_id']))
 
  409                                                $rbacadmin->setProtected($this->
getCurrentObject()->getRefId(), $role[
'obj_id'], 
'y');
 
  411                                        elseif(!isset(
$_POST[
'protect'][$role[
'obj_id']]) and 
 
  412                                                $rbacreview->isProtected($this->getCurrentObject()->getRefId(), $role[
'obj_id']))
 
  414                                                $rbacadmin->setProtected($this->
getCurrentObject()->getRefId(), $role[
'obj_id'], 
'n');
 
  426                if($blocked_info[
'num'] > 0)
 
  433                $this->ctrl->redirect($this,
'perm');
 
  445                if($a_blocked_info[
'new_blocked'])
 
  447                        $info .= $this->lng->txt(
'role_confirm_block_role_info');
 
  448                        if($a_blocked_info[
'new_unblocked'])
 
  450                                $info .= 
'<br /><br />';
 
  454                if($a_blocked_info[
'new_unblocked'])
 
  456                        $info .= (
'<br />'. $this->lng->txt(
'role_confirm_unblock_role_info'));
 
  461                include_once 
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
 
  463                $confirm->setFormAction($this->ctrl->getFormAction($this));
 
  464                $confirm->setHeaderText($this->lng->txt(
'role_confirm_block_role_header'));
 
  465                $confirm->setConfirm($this->lng->txt(
'role_confirm_block_role'), 
'modifyBlockRoles');
 
  466                $confirm->setCancel($this->lng->txt(
'cancel'), 
'perm');
 
  468                foreach($a_blocked_info[
'new_blocked'] as $role_id)
 
  470                        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  477                foreach($a_blocked_info[
'new_unblocked'] as $role_id)
 
  479                        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  486                $this->tpl->setContent($confirm->getHTML());
 
  496                $this->ctrl->redirect($this,
'perm');
 
  506                foreach($roles as $role)
 
  514                        $role_obj->changeExistingObjects(
 
  521                        $rbacadmin->setBlockedStatus(
 
  535                global $rbacadmin,$rbacreview;
 
  537                foreach($roles as $role)
 
  540                        $assign = $rbacreview->isAssignable($role, $this->
getCurrentObject()->getRefId()) ? 
'y' : 
'n';
 
  543                        $rbacadmin->revokeSubtreePermissions($this->
getCurrentObject()->getRefId(), $role);
 
  546                        $rbacadmin->deleteSubtreeTemplates($this->
getCurrentObject()->getRefId(), $role);
 
  549                        $rbacadmin->assignRoleToFolder(
 
  556                        $rbacadmin->setBlockedStatus(
 
  573                global $objDefinition;
 
  590                $GLOBALS[
'tpl']->setContent($form->getHTML());
 
  601                if($form->checkInput())
 
  605                                include_once 
'./Services/Export/classes/class.ilImport.php';
 
  609                                $imp->getMapping()->addMapping(
 
  610                                                'Services/AccessControl', 
 
  618                                                $_FILES[
"importfile"][
"tmp_name"],
 
  619                                                $_FILES[
"importfile"][
"name"],
 
  623                                $this->ctrl->redirect($this,
'perm');
 
  629                                $form->setValuesByPost();
 
  634                $form->setValuesByPost();
 
  644                include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  646                $form->setFormAction($this->ctrl->getFormAction($this));
 
  647                $form->setTitle($this->lng->txt(
'rbac_import_role'));
 
  648                $form->addCommandButton(
'doImportRole', $this->lng->txt(
'import'));
 
  649                $form->addCommandButton(
'perm', $this->lng->txt(
'cancel'));
 
  651                $zip = 
new ilFileInputGUI($this->lng->txt(
'import_file'),
'importfile');
 
  652                $zip->setSuffixes(array(
'zip'));
 
  653                $form->addItem($zip);
 
  666                global $rbacreview,$objDefinition;
 
  668                include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
  670                $form->setFormAction($this->ctrl->getFormAction($this));
 
  671                $form->setTitle($this->lng->txt(
'role_new'));
 
  672                $form->addCommandButton(
'addrole',$this->lng->txt(
'role_new'));
 
  673                $form->addCommandButton(
'perm', $this->lng->txt(
'cancel'));
 
  676                $title->setValidationRegexp(
'/^(?!il_).*$/');
 
  677                $title->setValidationFailureMessage($this->lng->txt(
'msg_role_reserved_prefix'));
 
  680                $title->setRequired(
true);
 
  686                $form->addItem($desc);
 
  689                $pro->setInfo($this->lng->txt(
'role_protect_permissions_desc'));
 
  691                $form->addItem($pro);
 
  694                $pd->setInfo($this->lng->txt(
'rbac_role_add_to_desktop_info'));
 
  702                        $option = 
new ilRadioOption($this->lng->txt(
"rbac_role_rights_copy_empty"), 0);
 
  703                        $rights->addOption($option);
 
  705                        $parent_role_ids = $rbacreview->getParentRoleIds($this->gui_obj->object->getRefId(),
true);
 
  707                        foreach($parent_role_ids as $id => $tmp)
 
  713                        $sorted_ids = 
ilUtil::_sortIds($ids,
'object_data',
'type DESC,title',
'obj_id');
 
  716                        foreach($sorted_ids as $id)
 
  718                                $par = $parent_role_ids[$id];
 
  719                                if ($par[
"obj_id"] != SYSTEM_ROLE_ID)
 
  721                                        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  723                                        $option->setInfo($par[
"desc"]);
 
  724                                        $rights->addOption($option);
 
  728                        $form->addItem($rights);
 
  732                if($objDefinition->isContainer($this->getCurrentObject()->getType()))
 
  734                        $check = 
new ilCheckboxInputGui($this->lng->txt(
"rbac_role_rights_copy_change_existing"), 
'existing');
 
  735                        $check->setInfo($this->lng->txt(
'rbac_change_existing_objects_desc_new_role'));
 
  736                        $form->addItem($check);
 
  751                $this->tpl->setContent($form->getHTML());
 
  767                if($form->checkInput())
 
  769                        $new_title = $form->getInput(
"title");
 
  771                        include_once 
'./Services/AccessControl/classes/class.ilObjRole.php';
 
  773                        $role->setTitle($new_title);
 
  774                        $role->setDescription($form->getInput(
'desc'));
 
  777                        $GLOBALS[
'rbacadmin']->assignRoleToFolder($role->getId(),$this->getCurrentObject()->getRefId());
 
  780                        $rbacadmin->setProtected(
 
  783                                $form->getInput(
'pro') ? 
'y' : 
'n' 
  787                        $right_id_to_copy = $form->getInput(
"rights");
 
  788                        if($right_id_to_copy)
 
  790                                $parentRoles = $rbacreview->getParentRoleIds($this->
getCurrentObject()->getRefId(),
true);
 
  791                                $rbacadmin->copyRoleTemplatePermissions(
 
  793                                        $parentRoles[$right_id_to_copy][
"parent"],
 
  798                                if($form->getInput(
'existing'))
 
  800                                        if($form->getInput(
'pro'))
 
  802                                                $role->changeExistingObjects(
 
  810                                                $role->changeExistingObjects(
 
  820                        if($form->getInput(
"desktop"))
 
  822                                include_once 
'Services/AccessControl/classes/class.ilRoleDesktopItem.php';
 
  824                                $role_desk_item_obj->add(
 
  830                        $this->ctrl->redirect($this,
'perm');
 
  834                        $form->setValuesByPost();
 
  835                        $this->tpl->setContent($form->getHTML());
 
  847                $blocked_info[
'new_blocked'] = array();
 
  848                $blocked_info[
'new_unblocked'] = array();
 
  849                $blocked_info[
'num'] = 0;
 
  850                foreach((array) 
$_POST[
'visible_block'] as $role => $one)
 
  852                        $blocked = $rbacreview->isBlockedAtPosition($role, $this->
getCurrentObject()->getRefId());
 
  853                        if(isset(
$_POST[
'block'][$role]) && !$blocked)
 
  855                                $blocked_info[
'new_blocked'][] = $role;
 
  856                                $blocked_info[
'num']++;
 
  858                        if(!isset(
$_POST[
'block'][$role]) && $blocked)
 
  860                                $blocked_info[
'new_unblocked'][] = $role;
 
  861                                $blocked_info[
'num']++;
 
  864                return $blocked_info;
 
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
GUI class for didactic template settings inside repository objects.
static getLogger($a_component_id)
Get component logger.
const MODE_UNPROTECTED_KEEP_LOCAL_POLICIES
static _getTranslation($a_role_title)
const MODE_PROTECTED_KEEP_LOCAL_POLICIES
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
This class displays the permission status of a user concerning a specific object.
Table for object role permissions.
const ROLE_FILTER_LOCAL_OBJECT
const ROLE_FILTER_LOCAL_POLICY
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilPermissionGUI RBAC related output.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
blockRoles($roles)
Block role.
displayImportRoleForm(ilPropertyFormGUI $form=null)
Show import form.
resetFilter()
Reset filter.
confirmTemplateSwitch()
Called after toolbar action applyTemplateSwitch.
isAdminRoleFolder()
Check of current location is administration (main) role folder.
__construct($a_gui_obj)
Constructor.
getModifiedBlockedSettings()
executeCommand()
Execute command.
displayAddRoleForm()
Show add role form.
savePermissions()
Save permissions.
getCurrentObject()
Get current object.
initRoleForm()
Shoew add role @global type $rbacreview @global type $objDefinition.
initImportForm()
init import form
static hasContainerCommands($a_type)
Check if container commands are possible for the current object type.
doImportRole()
Perform import.
applyRoleFilter($a_roles, $a_filter_id)
Apply filter to roles.
showConfirmBlockRole($a_blocked_info)
Show block role confirmation screen.
isInAdministration()
Check if node is subobject of administration folder.
perm(ilTable2GUI $table=NULL)
show permission table
applyFilter()
Apply filter.
addRole()
adds a local role This method is only called when choose the option 'you may add local roles'.
This class represents an option in a radio group.
static diffFaPa(array $a_old, array $a_new)
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
static lookupCreateOperationIds($a_type_arr)
Lookup operation ids.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,...
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.