ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 $DIC;
35
36 $ilAccess = $DIC['ilAccess'];
37
38 switch ($a_permission) {
39 case 'visible':
40 case 'read':
41 include_once './Modules/GroupReference/classes/class.ilObjGroupReference.php';
42 $target_ref_id = ilObjGroupReference::_lookupTargetRefId($a_obj_id);
43
44 if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
45 return false;
46 }
47 break;
48 }
49
50 return true;
51 }
52
73 public static function _getCommands($a_ref_id = 0)
74 {
75 global $DIC;
76
77 $ilAccess = $DIC['ilAccess'];
78
79 if ($ilAccess->checkAccess('write', '', $a_ref_id)) {
80 // Only local (reference specific commands)
81 $commands = array(
82 array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
83 array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")
84 );
85 } else {
86 include_once('./Modules/Group/classes/class.ilObjGroupAccess.php');
88 }
89 return $commands;
90 }
91}
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
$DIC
Definition: xapitoken.php:46