ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjSurveyQuestionPoolAccess.php
Go to the documentation of this file.
1<?php
2
20{
21 public static function _getCommands(): array
22 {
23 $commands = array(
24 array("permission" => "read",
25 "cmd" => "questions",
26 "lang_var" => "edit_questions",
27 "default" => true
28 ),
29 array("permission" => "write", "cmd" => "questions", "lang_var" => "edit_questions"),
30 array("permission" => "write", "cmd" => "properties", "lang_var" => "settings")
31 );
32
33 return $commands;
34 }
35
36 public static function _checkGoto(string $target): bool
37 {
38 global $DIC;
39
40 $ilAccess = $DIC->access();
41
42 $t_arr = explode("_", $target);
43
44 if ($ilAccess->checkAccess("visible", "", $t_arr[1]) ||
45 $ilAccess->checkAccess("read", "", $t_arr[1])) {
46 return true;
47 }
48 return false;
49 }
50
51 public function _checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id = null): bool
52 {
53 global $DIC;
54 $ilAccess = $DIC->access();
55
56 if (in_array($permission, ["read", "visible"]) && self::_isOffline(ilObject::_lookupObjId($ref_id))) {
57 if (!$ilAccess->checkAccessOfUser($user_id, "write", "", $ref_id)) {
58 return false;
59 }
60 }
61 return true;
62 }
63}
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 _checkGoto(string $target)
check whether goto script will succeed
Class ilObjectAccess.
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26