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

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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 _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 _lookupOnlineStatus (array $a_ids)
 Check whether booking pool is online (legacy version) 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...
 

Protected Attributes

ilLanguage $lng
 
ilAccessHandler $access
 
ilObjUser $user
 
ilRbacSystem $rbacsystem
 

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

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 22 of file class.ilObjBookingPoolAccess.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjBookingPoolAccess::__construct ( )

Definition at line 29 of file class.ilObjBookingPoolAccess.php.

30 {
31 global $DIC;
32
33 $this->user = $DIC->user();
34 $this->rbacsystem = $DIC->rbac()->system();
35 $this->access = $DIC->access();
36 $this->lng = $DIC->language();
37 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _checkAccess()

ilObjBookingPoolAccess::_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 68 of file class.ilObjBookingPoolAccess.php.

68 : bool
69 {
70 $ilUser = $this->user;
72
73 if ($user_id === null) {
74 $user_id = $ilUser->getId();
75 }
76
77 // add no access info item and return false if access is not granted
78 // $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $text, $data = "");
79 //
80 // for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:
81 // $rbacsystem->checkAccessOfUser($user_id, $permission, $ref_id)
82
83 //TODO refactor this: first check if the object is online and then the permissions.
84 #22653
85 if (($permission === "visible" || $permission === "read") && !$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id)) {
86 if (self::_isOffline($obj_id)) {
87 $this->access->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $this->lng->txt("offline"));
88 return false;
89 }
90 }
91
92 return true;
93 }
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
$ref_id
Definition: ltiauth.php:66

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

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjBookingPoolAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

Definition at line 49 of file class.ilObjBookingPoolAccess.php.

49 : bool
50 {
51 global $DIC;
52
53 $ilAccess = $DIC->access();
54
55 $t_arr = explode("_", $target);
56
57 if ($t_arr[0] !== "book" || ((int) $t_arr[1]) <= 0) {
58 return false;
59 }
60
61 if ($ilAccess->checkAccess("read", "", $t_arr[1]) ||
62 $ilAccess->checkAccess("visible", "", $t_arr[1])) {
63 return true;
64 }
65 return false;
66 }

References $DIC.

◆ _getCommands()

static ilObjBookingPoolAccess::_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 39 of file class.ilObjBookingPoolAccess.php.

39 : array
40 {
41 $commands = array();
42 $commands[] = array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true);
43 $commands[] = array("permission" => "write", "cmd" => "render", "lang_var" => "book_booking_objects");
44 $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
45
46 return $commands;
47 }

Referenced by ilObjBookingPoolListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupOnlineStatus()

static ilObjBookingPoolAccess::_lookupOnlineStatus ( array  $a_ids)
static

Check whether booking pool is online (legacy version)

Deprecated:

Definition at line 99 of file class.ilObjBookingPoolAccess.php.

99 : array
100 {
101 global $DIC;
102
103 $ilDB = $DIC->database();
104
105 $q = "SELECT booking_pool_id, pool_offline FROM booking_settings WHERE " .
106 $ilDB->in("booking_pool_id", $a_ids, false, "integer");
107 $lm_set = $ilDB->query($q);
108 $status = [];
109 while ($r = $ilDB->fetchAssoc($lm_set)) {
110 $status[$r["booking_pool_id"]] = !$r["pool_offline"];
111 }
112 return $status;
113 }
$q
Definition: shib_logout.php:23
$lm_set

References $DIC, $ilDB, $lm_set, and $q.

Referenced by ILIAS\Container\Content\Filter\FilterManager\legacyOnlineFilter().

+ Here is the caller graph for this function:

◆ canBeDelivered()

ilObjBookingPoolAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Reimplemented from ilObjectAccess.

Definition at line 115 of file class.ilObjBookingPoolAccess.php.

115 : bool
116 {
117 // we return always false, since the files in the file/ and post/ directoies
118 // are server by php (they could/should be moved to the data dir outside of the web doc root)
119 return false;
120 }

Field Documentation

◆ $access

ilAccessHandler ilObjBookingPoolAccess::$access
protected

Definition at line 25 of file class.ilObjBookingPoolAccess.php.

◆ $lng

ilLanguage ilObjBookingPoolAccess::$lng
protected

Definition at line 24 of file class.ilObjBookingPoolAccess.php.

◆ $rbacsystem

ilRbacSystem ilObjBookingPoolAccess::$rbacsystem
protected

Definition at line 27 of file class.ilObjBookingPoolAccess.php.

Referenced by _checkAccess().

◆ $user

ilObjUser ilObjBookingPoolAccess::$user
protected

Definition at line 26 of file class.ilObjBookingPoolAccess.php.

Referenced by _checkAccess().


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