ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjGroupReferenceAccess.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once("./Services/ContainerReference/classes/class.ilContainerReferenceAccess.php");
5
14{
32 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
33 {
34 global $ilAccess;
35
36 switch ($a_permission) {
37 case 'visible':
38 case 'read':
39 include_once './Modules/GroupReference/classes/class.ilObjGroupReference.php';
40 $target_ref_id = ilObjGroupReference::_lookupTargetRefId($a_obj_id);
41
42 if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
43 return false;
44 }
45 break;
46 }
47
48 return true;
49 }
50
71 public static function _getCommands($a_ref_id = 0)
72 {
73 global $ilAccess;
74
75 if ($ilAccess->checkAccess('write', '', $a_ref_id)) {
76 // Only local (reference specific commands)
77 $commands = array(
78 array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
79 array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")
80 );
81 } else {
82 include_once('./Modules/Group/classes/class.ilObjGroupAccess.php');
84 }
85 return $commands;
86 }
87}
An exception for terminatinating execution or to throw for unit testing.
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static _getCommands()
get commands
_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcce...
static _getCommands($a_ref_id=0)
get commands