ILIAS  release_8 Revision v8.24
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 31 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 66 of file class.ilLearningProgressAccess.php.

69 : bool {
70 global $DIC;
71
72 if ($DIC->user()->getId() == ANONYMOUS_USER_ID) {
73 return false;
74 }
75
77 return false;
78 }
79
81 if ($DIC->access()->checkAccess(
82 'read_learning_progress',
83 '',
84 $a_ref_id
85 ) ||
86 (
87 $DIC->access()->checkRbacOrPositionPermissionAccess(
90 $a_ref_id
91 ) && $olp->isActive()
92 )
93 ) {
94 return true;
95 }
96
97 if (!$DIC->access()->checkAccess('read', '', $a_ref_id)) {
98 return false;
99 }
100 // edit learning progress is sufficient: #0029313
101 if ($DIC->access()->checkAccess(
102 'edit_learning_progress',
103 '',
104 $a_ref_id
105 )) {
106 return true;
107 }
108
110 return false;
111 }
112
113 if (!$olp->isActive()) {
114 return false;
115 }
116
117 if ($a_allow_only_read) {
118 return true;
119 }
120 return false;
121 }
static getInstance(int $obj_id)
static _lookupObjId(int $ref_id)
const ANONYMOUS_USER_ID
Definition: constants.php:27
global $DIC
Definition: feed.php:28

Referenced by ilObjContentObjectGUI\addTabs(), ilObjLearningSequenceGUI\checkLPAccess(), ilLMExplorerGUI\checkLPIcon(), ilLearningProgressGUI\editManual(), ilObjCourseGUI\getTabs(), ilObjCourseReferenceGUI\getTabs(), ilObjFolderGUI\getTabs(), ilObjForumGUI\getTabs(), ilObjGroupGUI\getTabs(), ilObjFileBasedLMGUI\getTabs(), ilObjSAHSLearningModuleGUI\getTabs(), ilObjSessionGUI\getTabs(), ilObjSurveyGUI\getTabs(), ilCmiXapiAccess\hasLearningProgressAccess(), ilLTIConsumerAccess\hasLearningProgressAccess(), ilObjMediaCastGUI\initSettingsForm(), ilTestTabsManager\isLpAccessGranted(), ilLMMenuRendererGUI\render(), 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 36 of file class.ilLearningProgressAccess.php.

40 : bool {
41 global $DIC;
42
43 if ($a_user_id === null) {
44 $a_user_id = $DIC->user()->getId();
45 }
46
47 // position access
48 if ($a_permission === 'read_learning_progress') {
49 return $DIC->access()->checkRbacOrPositionPermissionAccess(
52 $a_ref_id
53 );
54 }
55 return $DIC->access()->checkAccessOfUser(
56 $a_user_id,
57 $a_permission,
58 '',
59 $a_ref_id
60 );
61 }

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: