ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjectAccess.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
32{
40 public function _checkAccess(string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id = null): bool
41 {
42 // add no access info item and return false if access is not granted
43 // $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $a_text, $a_data = "");
44 //
45 // for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:
46 // $rbacsystem->checkAccessOfUser($a_user_id, $a_permission, $a_ref_id)
47
48 return true;
49 }
50
64 public static function _getCommands(): array
65 {
66 return [];
67 }
68
72 public static function _checkGoto(string $target): bool
73 {
74 global $DIC;
75 $ilAccess = $DIC->access();
76
77 $arr = explode("_", $target);
78
79 if (
80 $ilAccess->checkAccess("read", "", (int) $arr[1]) ||
81 $ilAccess->checkAccess("visible", "", (int) $arr[1])
82 ) {
83 return true;
84 }
85 return false;
86 }
87
94 public static function _isOffline(int $obj_id): bool
95 {
96 global $DIC;
97
98 $objDefinition = $DIC['objDefinition'];
99 if ($objDefinition->supportsOfflineHandling(ilObject::_lookupType($obj_id))) {
100 return ilObject::lookupOfflineStatus($obj_id);
101 }
102 return false;
103 }
104
108 public static function _preloadData(array $obj_ids, array $ref_ids): void
109 {
110 }
111
115 public function canBeDelivered(ilWACPath $ilWACPath): bool
116 {
117 global $ilAccess;
118
119 if (preg_match("/\\/obj_([\\d]*)\\//uism", $ilWACPath->getPath(), $results)) {
120 foreach (ilObject2::_getAllReferences((int) $results[1]) as $ref_id) {
121 if ($ilAccess->checkAccess('visible', '', $ref_id) || $ilAccess->checkAccess('read', '', $ref_id)) {
122 return true;
123 }
124 }
125 }
126
127 return false;
128 }
129}
Class ilObjectAccess.
static _isOffline(int $obj_id)
Type-specific implementation of general status, has to be overwritten if object type does not support...
static _getCommands()
get commands
_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 _preloadData(array $obj_ids, array $ref_ids)
Preload data.
static _checkGoto(string $target)
check whether goto script will succeed
canBeDelivered(ilWACPath $ilWACPath)
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66
$results
global $DIC
Definition: shib_login.php:26