This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
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 ilObjMediaObjectAccess
- Author
- Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Definition at line 23 of file class.ilObjMediaObjectAccess.php.
◆ __construct()
ilObjMediaObjectAccess::__construct |
( |
| ) |
|
◆ canBeDelivered()
ilObjMediaObjectAccess::canBeDelivered |
( |
ilWACPath |
$ilWACPath | ) |
|
◆ checkAccessBlogPage()
ilObjMediaObjectAccess::checkAccessBlogPage |
( |
int |
$obj_id | ) |
|
|
protected |
Check access rights for blog pages.
- Parameters
-
Definition at line 340 of file class.ilObjMediaObjectAccess.php.
342 : bool {
345 $node_id = $tree->lookupNodeId($obj_id);
346 if (!$node_id) {
348 } else {
350 if ($access_handler->checkAccessOfUser($tree, $ilUser->getId(), "read", "view", $node_id, "blog")) {
351 return true;
352 }
353 }
354
355 return false;
356 }
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...
◆ checkAccessGlossaryTerm()
ilObjMediaObjectAccess::checkAccessGlossaryTerm |
( |
int |
$obj_id, |
|
|
int |
$page_id |
|
) |
| |
|
protected |
Check access rights for glossary terms This checks also learning modules linking the term.
- Parameters
-
int | $obj_id | object id (glossary) |
int | $page_id | page id (definition) |
- Returns
- bool access given (true/false)
Definition at line 273 of file class.ilObjMediaObjectAccess.php.
276 : bool {
277
279 return true;
280 }
281
282 $term_id = $page_id;
283
285
286 if ($sources) {
287 foreach ($sources as $src) {
288 switch ($src['type']) {
289
290
291 case 'lm:pg':
294 return true;
295 }
296 break;
297
298
299
300
301
302
303
304
305
306
307
308
309
310 }
311 }
312 }
313 return false;
314 }
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
◆ checkAccessLearningObjectivePage()
ilObjMediaObjectAccess::checkAccessLearningObjectivePage |
( |
int |
$obj_id, |
|
|
int |
$page_id |
|
) |
| |
|
protected |
◆ checkAccessMob()
ilObjMediaObjectAccess::checkAccessMob |
( |
int |
$obj_id | ) |
|
|
protected |
Definition at line 48 of file class.ilObjMediaObjectAccess.php.
50 : bool {
51
54
55 switch ($usage["type"]) {
56 case "auth:pg":
57
58 return true;
59 case "mep:pg":
61 foreach ($usages2 as $usage2) {
63 if ($this->checkAccessMobUsage($usage2, $oid2)) {
64 return true;
65 }
66 }
67 break;
68
69 case "clip":
70 if ($usage[
"id"] == $this->
user->getId()) {
71 return true;
72 }
73 break;
74
75 default:
76 if ($oid !== null && $this->checkAccessMobUsage($usage, $oid)) {
77 return true;
78 }
79
80 if ($oid === null) {
82 sprintf(
83 "Could not determine parent obj_id for usage: %s",
84 json_encode($usage, JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT)
85 )
86 );
87 }
88 break;
89 }
90 }
91
92 return false;
93 }
static lookupUsages(int $a_id, bool $a_incl_hist=true)
Lookup usages of media object.
References ilObjMediaObject\getParentObjectIdForUsage(), ILIAS\Repository\logger(), ilMediaPoolPage\lookupUsages(), and ILIAS\Repository\user().
Referenced by canBeDelivered().
◆ checkAccessObject()
ilObjMediaObjectAccess::checkAccessObject |
( |
int |
$obj_id, |
|
|
string |
$obj_type = '' |
|
) |
| |
|
protected |
Check access rights for an object by its object id.
Definition at line 211 of file class.ilObjMediaObjectAccess.php.
214 : bool {
218
219 if (!$obj_type) {
221 }
223
224 foreach ($ref_ids as
$ref_id) {
225
226 if ($ilAccess->checkAccessOfUser(
$user_id,
"read",
"view",
$ref_id, $obj_type, $obj_id)) {
227 return true;
228 }
229
230 }
231
232 return false;
233 }
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
References ilObject\_lookupType().
◆ checkAccessPortfolioPage()
ilObjMediaObjectAccess::checkAccessPortfolioPage |
( |
int |
$obj_id, |
|
|
int |
$page_id |
|
) |
| |
|
protected |
Check access rights for portfolio pages.
- Parameters
-
int | $obj_id | object id (glossary) |
int | $page_id | page id (definition) |
Definition at line 322 of file class.ilObjMediaObjectAccess.php.
325 : bool {
328 if ($access_handler->checkAccessOfUser($ilUser->getId(), "read", "view", $obj_id, "prtf")) {
329 return true;
330 }
331
332 return false;
333 }
Access handler for portfolio NOTE: This file needs to stay in the classes directory,...
◆ checkAccessTestQuestion()
ilObjMediaObjectAccess::checkAccessTestQuestion |
( |
int |
$obj_id, |
|
|
int |
$usage_id = 0 |
|
) |
| |
|
protected |
Check access rights for a test question This checks also tests with random selection of questions.
- Parameters
-
int | $obj_id | object id (question pool or test) |
Definition at line 241 of file class.ilObjMediaObjectAccess.php.
244 : bool {
245
247 return true;
248 }
249
251 if ($obj_type == 'qpl') {
252
253
255 foreach ($tests as $test_id) {
257 return true;
258 }
259 }
260 }
261
262 return false;
263 }
static _getRandomTestsForQuestionPool(int $qpl_id)
Get all tests using a question pool for random selection.
◆ $access
◆ $logger
ilLogger ilObjMediaObjectAccess::$logger |
|
protected |
◆ $obj_data_cache
◆ $user
The documentation for this class was generated from the following file: