ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 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 {
38 case 'visible':
39 case 'read':
40 include_once './Modules/GroupReference/classes/class.ilObjGroupReference.php';
41 $target_ref_id = ilObjGroupReference::_lookupTargetRefId($a_obj_id);
42
43 if(!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id))
44 {
45 return false;
46 }
47 break;
48 }
49
50 return true;
51 }
52
73 static function _getCommands($a_ref_id = 0)
74 {
75 global $ilAccess;
76
77 if($ilAccess->checkAccess('write','',$a_ref_id))
78 {
79 // Only local (reference specific commands)
80 $commands = array
81 (
82 array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
83 array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")
84 );
85 }
86 else
87 {
88 include_once('./Modules/Group/classes/class.ilObjGroupAccess.php');
90 }
91 return $commands;
92 }
93
94}
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