ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjSurveyQuestionPoolAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjSurveyQuestionPoolAccess:
+ Collaboration diagram for ilObjSurveyQuestionPoolAccess:

Public Member Functions

 _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::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _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::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilObjSurveyQuestionPoolAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjSurveyQuestionPoolAccess::_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::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Reimplemented from ilObjectAccess.

Definition at line 51 of file class.ilObjSurveyQuestionPoolAccess.php.

51 : 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 }
static _lookupObjId(int $ref_id)
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26

References $DIC, $ref_id, $user_id, and ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjSurveyQuestionPoolAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 36 of file class.ilObjSurveyQuestionPoolAccess.php.

36 : 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 }

References $DIC.

◆ _getCommands()

static ilObjSurveyQuestionPoolAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array("permission" => "read", "cmd" => "view", "lang_var" => "show"), array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"), );

Returns
array{permission?:string, cmd?:string, lang_var?:string, default?:bool}[]

Reimplemented from ilObjectAccess.

Definition at line 21 of file class.ilObjSurveyQuestionPoolAccess.php.

21 : 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 }

Referenced by ilObjSurveyQuestionPoolListGUI\init().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: