34 $this->obj_data_cache =
$DIC[
"ilObjDataCache"];
35 $this->
user = $DIC->user();
36 $this->
access = $DIC->access();
37 $this->
logger = $DIC->logger()->mob();
42 preg_match(
"/.\\/public\/data\\/.*\\/mm_([0-9]*)\\/.*/ui", $ilWACPath->
getPath(), $matches);
43 $obj_id = $matches[1] ?? 0;
55 switch ($usage[
"type"]) {
61 foreach ($usages2 as $usage2) {
63 if ($this->checkAccessMobUsage($usage2, $oid2)) {
70 if ($usage[
"id"] == $this->
user->getId()) {
76 if ($oid !==
null && $this->checkAccessMobUsage($usage, $oid)) {
83 "Could not determine parent obj_id for usage: %s",
84 json_encode($usage, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT)
96 protected function checkAccessMobUsage(
103 $ilObjDataCache = $this->obj_data_cache;
104 $ilUser = $this->user;
107 switch ($usage[
'type']) {
109 if ($this->checkAccessObject($oid,
'lm')) {
116 if ($this->checkAccessObject($oid)) {
127 if ($ilObjDataCache->lookupType($oid) ==
'usr' && $oid ==
$user_id) {
134 $draft_id = $usage[
'id'];
137 if (
$user_id == $oDraft->getPostAuthorId()) {
142 $history_id = $usage[
'id'];
145 if (
$user_id == $oDraft->getPostAuthorId()) {
152 if ($this->checkAccessTestQuestion($oid, $usage[
'id'])) {
159 if ($this->checkAccessGlossaryTerm($oid, $usage[
'id'])) {
166 if ($this->checkAccessObject($oid,
'sahs')) {
173 if ($this->checkAccessPortfolioPage($oid, $usage[
'id'])) {
180 if ($this->checkAccessBlogPage($oid)) {
187 if ($this->checkAccessLearningObjectivePage($oid, $usage[
'id'])) {
198 if ($this->checkAccessObject($oid)) {
213 string $obj_type =
''
215 $ilAccess = $this->
access;
216 $ilUser = $this->user;
224 foreach ($ref_ids as
$ref_id) {
226 if ($ilAccess->checkAccessOfUser(
$user_id,
"read",
"view",
$ref_id, $obj_type, $obj_id)) {
246 if ($this->checkAccessObject($obj_id)) {
251 if ($obj_type ==
'qpl') {
255 foreach ($tests as $test_id) {
256 if ($this->checkAccessObject($test_id,
'tst')) {
278 if ($this->checkAccessObject($obj_id)) {
287 foreach ($sources as $src) {
288 switch ($src[
'type']) {
293 if ($this->checkAccessObject($src_obj_id,
'lm')) {
326 $ilUser = $this->
user;
328 if ($access_handler->checkAccessOfUser($ilUser->getId(),
"read",
"view", $obj_id,
"prtf")) {
343 $ilUser = $this->
user;
345 $node_id = $tree->lookupNodeId($obj_id);
347 return $this->checkAccessObject($obj_id);
350 if ($access_handler->checkAccessOfUser($tree, $ilUser->getId(),
"read",
"view", $node_id,
"blog")) {
365 return $this->checkAccessObject($crs_obj_id,
'crs');
Class ilForumDraftHistory.
static newInstanceByDraftId(int $draft_id)
static _getSourcesOfTarget(string $a_target_type, int $a_target_id, int $a_target_inst)
get all sources of a link target
static _lookupContObjID(int $a_id)
get learning module id for lm object
Component logger with individual log levels by component id.
static lookupUsages(int $a_id, bool $a_incl_hist=true)
Lookup usages of media object.
static _lookupVisibility(int $a_news_id)
Lookup News Visibility.
static _getRandomTestsForQuestionPool(int $qpl_id)
Get all tests using a question pool for random selection.
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))