4 include_once
'./Services/AccessControl/classes/class.ilPermission2GUI.php';
39 return $this->gui_obj->object;
48 global $objDefinition, $ilToolbar;
50 if($objDefinition->hasLocalRoles($this->getCurrentObject()->getType()) and !$this->
isAdminRoleFolder())
53 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
54 $ilToolbar->addButton($this->lng->txt(
'rbac_add_new_local_role'),$this->ctrl->getLinkTarget($this,
'displayAddRoleForm'));
61 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
65 $this->tpl->setContent($table->getHTML());
85 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
87 $table->resetOffset();
88 $table->writeFilterToSession();
89 return $this->
perm($table);
98 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
100 $table->resetOffset();
101 $table->resetFilter();
103 return $this->
perm($table);
116 if(isset($a_roles[SYSTEM_ROLE_ID]))
118 unset($a_roles[SYSTEM_ROLE_ID]);
121 switch ($a_filter_id)
131 $arr_global_roles = $rbacreview->getGlobalRoles();
132 $arr_remove_roles = array_diff(array_keys($a_roles),$arr_global_roles);
134 foreach ($arr_remove_roles as $role_id)
136 unset($a_roles[$role_id]);
142 $arr_global_roles = $rbacreview->getGlobalRoles();
144 foreach ($arr_global_roles as $role_id)
146 unset($a_roles[$role_id]);
154 $role_folder = $rbacreview->getRoleFolderOfObject($this->gui_obj->object->getRefId());
161 $arr_local_roles = $rbacreview->getRolesOfRoleFolder($role_folder[
"ref_id"]);
162 $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);
164 foreach ($arr_remove_roles as $role_id)
166 unset($a_roles[$role_id]);
174 $role_folder = $rbacreview->getRoleFolderOfObject($this->gui_obj->object->getRefId());
181 $arr_local_roles = $rbacreview->getRolesOfRoleFolder($role_folder[
"ref_id"],
false);
182 $arr_remove_roles = array_diff(array_keys($a_roles),$arr_local_roles);
184 foreach ($arr_remove_roles as $role_id)
186 unset($a_roles[$role_id]);
202 global $rbacreview,$objDefinition,$rbacadmin;
204 include_once
'./Services/AccessControl/classes/class.ilObjectRolePermissionTableGUI.php';
208 $rbacreview->getParentRoleIds($this->getCurrentObject()->getRefId()),
209 $table->getFilterItemByPostVar(
'role')->getValue()
213 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
217 # all possible create permissions
218 $possible_ops_ids = $rbacreview->getOperationsByTypeAndClass(
223 # createable (activated) create permissions
224 $create_types = $objDefinition->getCreatableSubObjects(
229 foreach((array) $roles as $role => $role_data)
231 if($role_data[
'protected'])
236 $new_ops = array_keys((array)
$_POST[
'perm'][$role]);
237 $old_ops = $rbacreview->getRoleOperationsOnObject(
243 foreach($possible_ops_ids as $create_ops_id)
245 if(in_array($create_ops_id,$createable_ops_ids))
249 if(in_array($create_ops_id,$old_ops))
251 $new_ops[] = $create_ops_id;
255 $rbacadmin->revokePermission(
260 $rbacadmin->grantPermission(
262 array_unique($new_ops),
269 $relevant_roles = array_intersect(
270 $rbacreview->getRolesOfRoleFolder($rolf_id),
276 foreach($roles as $role)
279 if($role[
'parent'] == $rolf_id and $role[
'assign'] ==
'y')
284 if($role[
'protected'])
289 if($role[
'parent'] == $rolf_id and !isset($_POST[
'inherit'][$role[
'obj_id']]))
292 $role_obj->setParent($rolf_id);
297 if($role[
'parent'] != $rolf_id and isset($_POST[
'inherit'][$role[
'obj_id']]))
299 $rbacadmin->copyRoleTemplatePermissions(
305 $rbacadmin->assignRoleToFolder($role[
'obj_id'],$rolf_id,
'n');
313 foreach($roles as $role)
315 if($rbacreview->isAssignable($role[
'obj_id'], $rolf_id))
317 if(isset($_POST[
'protect'][$role[
'obj_id']]) and
318 !$rbacreview->isProtected($rolf_id, $role[
'obj_id']))
320 $rbacadmin->setProtected($rolf_id, $role[
'obj_id'],
'y');
322 elseif(!isset($_POST[
'protect'][$role[
'obj_id']]) and
323 $rbacreview->isProtected($rolf_id, $role[
'obj_id']))
325 $rbacadmin->setProtected($rolf_id, $role[
'obj_id'],
'n');
335 if(count((array) $_POST[
'block']))
342 #$this->ctrl->redirect($this,'perm');
355 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
357 $confirm->setFormAction($this->ctrl->getFormAction($this));
358 $confirm->setHeaderText($this->lng->txt(
'role_confirm_block_role_header'));
359 $confirm->setConfirm($this->lng->txt(
'role_block_role'),
'blockRoles');
360 $confirm->setCancel($this->lng->txt(
'cancel'),
'perm');
362 foreach($a_roles as $role_id)
364 include_once
'./Services/AccessControl/classes/class.ilObjRole.php';
371 $this->tpl->setContent($confirm->getHTML());
381 global $rbacadmin,$rbacreview;
383 $rolf = $rbacreview->getRoleFolderIdOfObject($this->
getCurrentObject()->getRefId());
385 $p_roles = $rbacreview->getParentRoleIds($this->
getCurrentObject()->getRefId());
388 foreach($roles as $role)
391 $assign = $rbacreview->isAssignable($role, $rolf) ?
'y' :
'n';
394 $rbacadmin->revokeSubtreePermissions($this->
getCurrentObject()->getRefId(), $role);
397 $rbacadmin->deleteSubtreeTemplates($this->
getCurrentObject()->getRefId(), $role);
400 $rbacadmin->assignRoleToFolder(
408 $this->ctrl->redirect($this,
'perm');
420 $rolf_id = $rbacreview->getRoleFolderIdOfObject($this->
getCurrentObject()->getRefId());
427 return $rolf->getRefId();
437 global $objDefinition;
439 return $objDefinition->isContainer($a_type) and $a_type !=
'root' and $a_type !=
'adm' and $a_type !=
'rolf';