ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjGroupReferenceAccess.php
Go to the documentation of this file.
1<?php
2
26{
34 public function _checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id = null): bool
35 {
36 global $DIC;
37
38 $ilAccess = $DIC['ilAccess'];
39
40 switch ($permission) {
41 case 'visible':
42 case 'read':
43 $target_ref_id = (int) ilObjGroupReference::_lookupTargetRefId($obj_id);
44
45 if (!$target_ref_id || !$ilAccess->checkAccessOfUser($user_id, $permission, $cmd, $target_ref_id)) {
46 return false;
47 }
48 break;
49 }
50
51 return true;
52 }
53
72 public static function _getCommands($a_ref_id = 0): array
73 {
74 global $DIC;
75
76 $ilAccess = $DIC['ilAccess'];
77
78 if ($ilAccess->checkAccess('write', '', $a_ref_id)) {
79 // Only local (reference specific commands)
80 $commands = array(
81 array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
82 array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")
83 );
84 } else {
86 }
87 return $commands;
88 }
89}
static _lookupTargetRefId(int $a_obj_id)
static _getCommands()
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
_checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAcc...
static _getCommands($a_ref_id=0)
get commands
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26