4 include_once
'./Services/AccessControl/classes/class.ilPermission2GUI.php';
39 return $this->gui_obj->object;
47 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
48 $this->ctrl->setReturn($this,
'perm');
49 $this->ctrl->setCmdClass(
'ildidactictemplategui');
51 $this->ctrl->forwardCommand($dtpl_gui,
'confirmTemplateSwitch');
61 global $objDefinition, $ilToolbar;
63 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
65 if($dtpl->appendToolbarSwitch(
67 $this->getCurrentObject()->getType(),
71 $ilToolbar->addSeparator();
74 if($objDefinition->hasLocalRoles($this->getCurrentObject()->getType()) and
80 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
81 $ilToolbar->addButton($this->lng->txt(
'rbac_add_new_local_role'),$this->ctrl->getLinkTarget($this,
'displayAddRoleForm'));
88 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
92 $this->tpl->setContent($table->getHTML());
117 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
119 $table->resetOffset();
120 $table->writeFilterToSession();
121 return $this->
perm($table);
130 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
132 $table->resetOffset();
133 $table->resetFilter();
135 return $this->
perm($table);
148 if(isset($a_roles[SYSTEM_ROLE_ID]))
150 unset($a_roles[SYSTEM_ROLE_ID]);
153 switch ($a_filter_id)
163 $arr_global_roles = $rbacreview->getGlobalRoles();
164 $arr_remove_roles = array_diff(array_keys($a_roles),$arr_global_roles);
166 foreach ($arr_remove_roles as $role_id)
168 unset($a_roles[$role_id]);
174 $arr_global_roles = $rbacreview->getGlobalRoles();
176 foreach ($arr_global_roles as $role_id)
178 unset($a_roles[$role_id]);
186 $role_folder = $rbacreview->getRoleFolderOfObject($this->gui_obj->object->getRefId());
193 $arr_local_roles = $rbacreview->getRolesOfRoleFolder($role_folder[
"ref_id"]);
194 $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);
196 foreach ($arr_remove_roles as $role_id)
198 unset($a_roles[$role_id]);
206 $role_folder = $rbacreview->getRoleFolderOfObject($this->gui_obj->object->getRefId());
213 $arr_local_roles = $rbacreview->getRolesOfRoleFolder($role_folder[
"ref_id"],
false);
214 $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);
216 foreach ($arr_remove_roles as $role_id)
218 unset($a_roles[$role_id]);
234 global $rbacreview,$objDefinition,$rbacadmin;
236 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
240 $rbacreview->getParentRoleIds($this->getCurrentObject()->getRefId()),
241 $table->getFilterItemByPostVar(
'role')->getValue()
245 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
249 # all possible create permissions
250 $possible_ops_ids = $rbacreview->getOperationsByTypeAndClass(
255 # createable (activated) create permissions
256 $create_types = $objDefinition->getCreatableSubObjects(
261 foreach((array) $roles as $role => $role_data)
263 if($role_data[
'protected'])
268 $new_ops = array_keys((array)
$_POST[
'perm'][$role]);
269 $old_ops = $rbacreview->getRoleOperationsOnObject(
275 foreach($possible_ops_ids as $create_ops_id)
277 if(in_array($create_ops_id,$createable_ops_ids))
281 if(in_array($create_ops_id,$old_ops))
283 $new_ops[] = $create_ops_id;
287 $rbacadmin->revokePermission(
292 $rbacadmin->grantPermission(
294 array_unique($new_ops),
301 $relevant_roles = array_intersect(
302 $rbacreview->getRolesOfRoleFolder($rolf_id),
308 foreach($roles as $role)
311 if($role[
'parent'] == $rolf_id and $role[
'assign'] ==
'y')
316 if($role[
'protected'])
321 if($role[
'parent'] == $rolf_id and !isset($_POST[
'inherit'][$role[
'obj_id']]))
324 $role_obj->setParent($rolf_id);
329 if($role[
'parent'] != $rolf_id and isset($_POST[
'inherit'][$role[
'obj_id']]))
331 $rbacadmin->copyRoleTemplatePermissions(
337 $rbacadmin->assignRoleToFolder($role[
'obj_id'],$rolf_id,
'n');
345 foreach($roles as $role)
347 if($rbacreview->isAssignable($role[
'obj_id'], $rolf_id))
349 if(isset($_POST[
'protect'][$role[
'obj_id']]) and
350 !$rbacreview->isProtected($rolf_id, $role[
'obj_id']))
352 $rbacadmin->setProtected($rolf_id, $role[
'obj_id'],
'y');
354 elseif(!isset($_POST[
'protect'][$role[
'obj_id']]) and
355 $rbacreview->isProtected($rolf_id, $role[
'obj_id']))
357 $rbacadmin->setProtected($rolf_id, $role[
'obj_id'],
'n');
367 if(count((array) $_POST[
'block']))
374 #$this->ctrl->redirect($this,'perm');
387 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
389 $confirm->setFormAction($this->ctrl->getFormAction($this));
390 $confirm->setHeaderText($this->lng->txt(
'role_confirm_block_role_header'));
391 $confirm->setConfirm($this->lng->txt(
'role_block_role'),
'blockRoles');
392 $confirm->setCancel($this->lng->txt(
'cancel'),
'perm');
394 foreach($a_roles as $role_id)
396 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
403 $this->tpl->setContent($confirm->getHTML());
413 global $rbacadmin,$rbacreview;
415 $rolf = $rbacreview->getRoleFolderIdOfObject($this->
getCurrentObject()->getRefId());
417 $p_roles = $rbacreview->getParentRoleIds($this->
getCurrentObject()->getRefId());
420 foreach($roles as $role)
423 $assign = $rbacreview->isAssignable($role, $rolf) ?
'y' :
'n';
426 $rbacadmin->revokeSubtreePermissions($this->
getCurrentObject()->getRefId(), $role);
429 $rbacadmin->deleteSubtreeTemplates($this->
getCurrentObject()->getRefId(), $role);
432 $rbacadmin->assignRoleToFolder(
440 $this->ctrl->redirect($this,
'perm');
452 $rolf_id = $rbacreview->getRoleFolderIdOfObject($this->
getCurrentObject()->getRefId());
459 return $rolf->getRefId();
469 global $objDefinition;
471 return $objDefinition->isContainer($a_type) and $a_type !=
'root' and $a_type !=
'adm' and $a_type !=
'rolf';