ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjQuestionPoolAccess 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 ilObjQuestionPoolAccess:
+ Collaboration diagram for ilObjQuestionPoolAccess:

Public Member Functions

 __construct ()
 
 _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 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...
 

Private Attributes

ilObjUser $current_user
 
ilLanguage $lng
 
ilRbacSystem $rbacsystem
 
ilAccess $access
 

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 Class ilObjQuestionPoolAccess

Author
Helmut Schottmueller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ \

Definition at line 28 of file class.ilObjQuestionPoolAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjQuestionPoolAccess::__construct ( )

Definition at line 35 of file class.ilObjQuestionPoolAccess.php.

36 {
37 global $DIC;
38 $this->current_user = $DIC['ilUser'];
39 $this->lng = $DIC['lng'];
40 $this->rbacsystem = $DIC['rbacsystem'];
41 $this->access = $DIC['ilAccess'];
42 ;
43 }
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\access(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjQuestionPoolAccess::_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 70 of file class.ilObjQuestionPoolAccess.php.

70 : bool
71 {
72 if (is_null($user_id)) {
73 $user_id = $this->current_user->getId();
74 }
75
76 if ($this->rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id)) {
77 return true;
78 }
79
80 switch ($permission) {
81 case 'visible':
82 case 'read':
83 if (self::_isOffline($obj_id)) {
84 $this->access->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $this->lng->txt("tst_warning_pool_offline"));
85 return false;
86 }
87 break;
88 }
89
90 return true;
91 }
$ref_id
Definition: ltiauth.php:66

References $ref_id, $user_id, ILIAS\Repository\access(), ilAccessInfo\IL_NO_OBJECT_ACCESS, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ _getCommands()

static ilObjQuestionPoolAccess::_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"), );

Reimplemented from ilObjectAccess.

Definition at line 56 of file class.ilObjQuestionPoolAccess.php.

56 : array
57 {
58 $commands = [
59 ["permission" => "write", "cmd" => "questions", "lang_var" => "tst_edit_questions"],
60 ["permission" => "write", "cmd" => "ilObjQuestionPoolSettingsGeneralGUI::showForm", "lang_var" => "settings"],
61 #array("permission" => "write", "cmd" => "questions", "lang_var" => "edit",
62 # "default" => false),
63 ["permission" => "read", "cmd" => "questions", "lang_var" => "edit",
64 "default" => true]
65 ];
66
67 return $commands;
68 }

Referenced by ilObjQuestionPoolListGUI\init().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilAccess ilObjQuestionPoolAccess::$access
private

Definition at line 33 of file class.ilObjQuestionPoolAccess.php.

◆ $current_user

ilObjUser ilObjQuestionPoolAccess::$current_user
private

Definition at line 30 of file class.ilObjQuestionPoolAccess.php.

◆ $lng

ilLanguage ilObjQuestionPoolAccess::$lng
private

Definition at line 31 of file class.ilObjQuestionPoolAccess.php.

◆ $rbacsystem

ilRbacSystem ilObjQuestionPoolAccess::$rbacsystem
private

Definition at line 32 of file class.ilObjQuestionPoolAccess.php.


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