ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLearningProgressAccess Class Reference

Learning progress access checks. More...

+ Collaboration diagram for ilLearningProgressAccess:

Static Public Member Functions

static checkPermission ($a_permission, $a_ref_id, $a_user_id=null)
 wrapper for rbac access checks More...
 
static checkAccess ($a_ref_id, $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
Version
$Id$

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

Member Function Documentation

◆ checkAccess()

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

check access to learning progress

Parameters
int$a_ref_idreference id of object
bool$a_allow_only_readread access is sufficient (see courses/groups)
Returns
bool

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

65 {
66 global $DIC;
67
68 if ($DIC->user()->getId() == ANONYMOUS_USER_ID) {
69 return false;
70 }
71
73 return false;
74 }
75
77 if (
78 $DIC->access()->checkAccess('read_learning_progress', '', $a_ref_id) ||
79 (
80 $DIC->access()->checkRbacOrPositionPermissionAccess(
81 'read_learning_progress',
83 $a_ref_id
84 ) && $olp->isActive()
85 )
86 ) {
87 return true;
88 }
89
91 return false;
92 }
93
94 if (!$olp->isActive()) {
95 return false;
96 }
97
98 if (!$DIC->access()->checkAccess('read', '', $a_ref_id)) {
99 return false;
100 }
101
102 if ($a_allow_only_read) {
103 return true;
104 }
105
106 return false;
107 }
static _enabledLearningProgress()
check wether learing progress is enabled or not
static getInstance($a_obj_id)
static _lookupObjId($a_id)
global $DIC
Definition: saml.php:7

References $DIC, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_hasLearningProgressLearner(), ilObject\_lookupObjId(), ilObjectLP\getInstance(), and ilOrgUnitOperation\OP_READ_LEARNING_PROGRESS.

Referenced by ilObjContentObjectGUI\addTabs(), ilObjLearningSequenceGUI\checkLPAccess(), ilLMExplorerGUI\checkLPIcon(), ilLearningProgressGUI\editManual(), ilObjContentPageGUI\executeCommand(), ilObjCourseGUI\getTabs(), ilObjExerciseGUI\getTabs(), ilObjFolderGUI\getTabs(), ilObjGroupGUI\getTabs(), ilObjFileBasedLMGUI\getTabs(), ilObjSAHSLearningModuleGUI\getTabs(), ilObjSessionGUI\getTabs(), ilObjSurveyGUI\getTabs(), ilTestTabsManager\isLpAccessGranted(), ilObjSCORMLearningModuleGUI\offlineModeManager(), ilObjContentObjectGUI\setilLMMenu(), ilSAHSPresentationGUI\setInfoTabs(), ilObjContentPageGUI\setTabs(), ilObjFileGUI\setTabs(), ilObjMediaCastGUI\setTabs(), and ilLearningProgressGUI\updateManual().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermission()

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

wrapper for rbac access checks

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

39 {
40 if (is_null($a_user_id)) {
41 $a_user_id = $GLOBALS['DIC']['ilUser']->getId();
42 }
43
44 // position access
45 if ($a_permission == 'read_learning_progress') {
46 return $GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess(
47 'read_learning_progress',
48 'read_learning_progress',
49 $a_ref_id
50 );
51 }
52 return $GLOBALS['DIC']['ilAccess']->checkAccessOfUser($a_user_id, $a_permission, '', $a_ref_id);
53 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $GLOBALS.

Referenced by ilTrObjectUsersPropsTableGUI\__construct(), ilLearningProgressGUI\__getNextClass(), ilLearningProgressBaseGUI\__setSubTabs(), ilLPListOfObjectsGUI\editUser(), ilLearningProgressGUI\executeCommand(), ilLPCollectionSettingsTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilTrSummaryTableGUI\getItems(), ilTrUserObjectsPropsTableGUI\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: