ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilLearningProgressAccess Class Reference

Learning progress access checks. More...

+ Collaboration diagram for ilLearningProgressAccess:

Static Public Member Functions

static checkPermission (string $a_permission, int $a_ref_id, ?int $a_user_id=null)
 wrapper for rbac access checks More...
 
static checkAccess (int $a_ref_id, bool $a_allow_only_read=true)
 check access to learning progress More...
 

Detailed Description

Learning progress access checks.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

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

Member Function Documentation

◆ checkAccess()

static ilLearningProgressAccess::checkAccess ( int  $a_ref_id,
bool  $a_allow_only_read = true 
)
static

check access to learning progress

Definition at line 60 of file class.ilLearningProgressAccess.php.

63 : bool {
64 global $DIC;
65
66 if ($DIC->user()->getId() == ANONYMOUS_USER_ID) {
67 return false;
68 }
69
71 return false;
72 }
73
75 if (
76 $olp->isActive() && (
77 $DIC->access()->checkAccess(
78 'read_learning_progress',
79 '',
80 $a_ref_id
81 ) ||
82 $DIC->access()->checkRbacOrPositionPermissionAccess(
85 $a_ref_id
86 )
87 )
88 ) {
89 return true;
90 }
91
92 if (!$DIC->access()->checkAccess('read', '', $a_ref_id)) {
93 return false;
94 }
95 // edit learning progress is sufficient: #0029313
96 if ($DIC->access()->checkAccess(
97 'edit_learning_progress',
98 '',
99 $a_ref_id
100 )) {
101 return true;
102 }
103
105 return false;
106 }
107
108 if (!$olp->isActive()) {
109 return false;
110 }
111
112 if ($a_allow_only_read) {
113 return true;
114 }
115 return false;
116 }
static getInstance(int $obj_id)
static _lookupObjId(int $ref_id)
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: shib_login.php:26

Referenced by ilObjContentObjectGUI\addTabs(), ilObjLearningSequenceGUI\checkLPAccess(), ilLMExplorerGUI\checkLPIcon(), ilLearningProgressGUI\editManual(), ILIAS\MediaCast\Settings\SettingsGUI\getEditForm(), ilObjCourseGUI\getTabs(), ilObjCourseReferenceGUI\getTabs(), ilObjFolderGUI\getTabs(), ilObjForumGUI\getTabs(), ilObjGroupGUI\getTabs(), ilObjFileBasedLMGUI\getTabs(), ilObjSAHSLearningModuleGUI\getTabs(), ilObjSessionGUI\getTabs(), ilObjSurveyGUI\getTabs(), ilCmiXapiAccess\hasLearningProgressAccess(), ilLTIConsumerAccess\hasLearningProgressAccess(), ilLMMenuRendererGUI\render(), ILIAS\MediaCast\Settings\SettingsGUI\save(), ilSAHSPresentationGUI\setInfoTabs(), ilObjContentPageGUI\setTabs(), ilObjFileGUI\setTabs(), ilObjMediaCastGUI\setTabs(), ilObjForumGUI\showStatisticsObject(), and ilLearningProgressGUI\updateManual().

+ Here is the caller graph for this function:

◆ checkPermission()

static ilLearningProgressAccess::checkPermission ( string  $a_permission,
int  $a_ref_id,
?int  $a_user_id = null 
)
static

wrapper for rbac access checks

Definition at line 30 of file class.ilLearningProgressAccess.php.

34 : bool {
35 global $DIC;
36
37 if ($a_user_id === null) {
38 $a_user_id = $DIC->user()->getId();
39 }
40
41 // position access
42 if ($a_permission === 'read_learning_progress') {
43 return $DIC->access()->checkRbacOrPositionPermissionAccess(
46 $a_ref_id
47 );
48 }
49 return $DIC->access()->checkAccessOfUser(
50 $a_user_id,
51 $a_permission,
52 '',
53 $a_ref_id
54 );
55 }

References $DIC.

Referenced by ilTrObjectUsersPropsTableGUI\__construct(), ilLearningProgressGUI\__getNextClass(), ilLearningProgressBaseGUI\__setSubTabs(), ilLPListOfProgressGUI\details(), ilLPListOfObjectsGUI\editUser(), ilLearningProgressGUI\executeCommand(), ilLPCollectionSettingsTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\getItems(), ilTrSummaryTableGUI\getItems(), ilTrMatrixTableGUI\getSelectableColumns(), and ilLPListOfObjectsGUI\updateUser().

+ Here is the caller graph for this function:

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