ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
class.ilObjLTIToolAccess.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
28{
32 public static function getConditionOperators(): array
33 {
35 }
36
37 public static function checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id): bool
38 {
39 return $a_operator === ilConditionHandler::OPERATOR_PASSED
40 && ilLPStatus::_hasUserCompleted($a_trigger_obj_id, $a_usr_id);
41 }
42
46 public static function hasLearningProgressAccess(ilObjLTITool $object): bool
47 {
48 return $object->getTool()->hasOutcome() && ilLearningProgressAccess::checkAccess($object->getRefId());
49 }
50
54 public static function hasStatementsAccess(ilObjLTITool $object): bool
55 {
56 return $object->getUseXapi() && ($object->isStatementsReportEnabled() || self::hasOutcomesAccess($object));
57 }
58
62 public static function hasRankingAccess(ilObjLTITool $object): bool
63 {
64 return $object->getUseXapi() && ($object->getHighscoreEnabled() || self::hasOutcomesAccess($object));
65 }
66
67 public static function hasOutcomesAccess(ilObjLTITool $object): bool
68 {
69 global $DIC;
70
71 return $DIC->access()->checkAccess('read_outcomes', '', $object->getRefId());
72 }
73
77 public static function _getCommands(): array
78 {
79 return [
80 [
81 'permission' => 'read',
83 'lang_var' => '',
84 'default' => true,
85 ],
86 [
87 'permission' => 'write',
88 'cmd' => ilLTIObjectSettingsGUI::class . '::' . ilLTIObjectSettingsGUI::CMD_SHOW,
89 'lang_var' => 'settings',
90 ],
91 ];
92 }
93}
static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
Access checks of the repository object type lti.
static hasRankingAccess(ilObjLTITool $object)
The ranking is shown to everybody when the object enables it, otherwise to who may read the outcomes.
static hasOutcomesAccess(ilObjLTITool $object)
static checkCondition(int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
check condition for a specific user and object
static hasLearningProgressAccess(ilObjLTITool $object)
The learning progress only exists for a tool that reports results.
static hasStatementsAccess(ilObjLTITool $object)
The statements are shown to everybody when the object says so, otherwise to who may read the outcomes...
A repository object of type lti: one external tool made available at one place of the repository.
isStatementsReportEnabled()
True when every user may see their own statements, not only the users who may read the outcomes.
getUseXapi()
True when the object reports on the xAPI statements of its tool, which has to send them.
Class ilObjectAccess.
Interface for condition handling.
global $DIC
Definition: shib_login.php:26