ILIAS  release_8 Revision v8.24
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

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 27 of file class.ilObjBookingPoolAccess.php.

28 {
29 global $DIC;
30
31 $this->user = $DIC->user();
32 $this->rbacsystem = $DIC->rbac()->system();
33 }
global $DIC
Definition: feed.php:28

References $DIC, 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 64 of file class.ilObjBookingPoolAccess.php.

64 : bool
65 {
68
69 if ($user_id === null) {
70 $user_id = $ilUser->getId();
71 }
72
73 // add no access info item and return false if access is not granted
74 // $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $text, $data = "");
75 //
76 // for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:
77 // $rbacsystem->checkAccessOfUser($user_id, $permission, $ref_id)
78
79 //TODO refactor this: first check if the object is online and then the permissions.
80 #22653
81 if (($permission === "visible" || $permission === "read") && !$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id)) {
82 $pool = new ilObjBookingPool($ref_id);
83 if ($pool->isOffline()) {
84 return false;
85 }
86 }
87
88 return true;
89 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkAccessOfUser(int $a_user_id, string $a_operations, int $a_ref_id, string $a_type="")
$ilUser
Definition: imgupload.php:34
$ref_id
Definition: ltiauth.php:67

References $ilUser, $rbacsystem, $ref_id, $user, and ilRbacSystem\checkAccessOfUser().

+ 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 45 of file class.ilObjBookingPoolAccess.php.

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

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 35 of file class.ilObjBookingPoolAccess.php.

35 : array
36 {
37 $commands = array();
38 $commands[] = array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true);
39 $commands[] = array("permission" => "write", "cmd" => "render", "lang_var" => "edit_content");
40 $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
41
42 return $commands;
43 }

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 95 of file class.ilObjBookingPoolAccess.php.

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

References $DIC, $ilDB, and $lm_set.

Referenced by ilContainer\legacyOnlineFilter().

+ Here is the caller graph for this function:

◆ canBeDelivered()

ilObjBookingPoolAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Reimplemented from ilObjectAccess.

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

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

Field Documentation

◆ $rbacsystem

ilRbacSystem ilObjBookingPoolAccess::$rbacsystem
protected

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

Referenced by _checkAccess().

◆ $user

ilObjUser ilObjBookingPoolAccess::$user
protected

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

Referenced by _checkAccess().


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