ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 ifd of object
bool$a_allow_only_readread access is sufficient (see courses/groups)
Returns

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

68 {
69 global $ilUser,$ilAccess;
70
71 if($ilUser->getId() == ANONYMOUS_USER_ID)
72 {
73 return false;
74 }
75
76 include_once("Services/Tracking/classes/class.ilObjUserTracking.php");
78 {
79 return false;
80 }
81
82 // workaround for missing file object permissions
83 if(ilObject::_lookupType($a_ref_id, true) == 'file' &&
84 $ilAccess->checkAccess('write','',$a_ref_id)
85 )
86 {
87 return true;
88 }
89
90 if($ilAccess->checkAccess('read_learning_progress','',$a_ref_id) ||
91 $ilAccess->checkAccess('edit_learning_progress','',$a_ref_id))
92 {
93 return true;
94 }
95
97 {
98 return false;
99 }
100
101 include_once './Services/Object/classes/class.ilObjectLP.php';
103 if(!$olp->isActive())
104 {
105 return false;
106 }
107
108 if(!$ilAccess->checkAccess('read','',$a_ref_id))
109 {
110 return false;
111 }
112
113 if($a_allow_only_read)
114 {
115 return true;
116 }
117
118 return false;
119 }
static _enabledLearningProgress()
check wether learing progress is enabled or not
static getInstance($a_obj_id)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15

References $ilUser, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_hasLearningProgressLearner(), ilObject\_lookupObjId(), ilObject\_lookupType(), and ilObjectLP\getInstance().

Referenced by ilObjContentObjectGUI\addTabs(), ilLMExplorerGUI\checkLPIcon(), ilLearningProgressGUI\editManual(), ilObjExerciseGUI\getTabs(), ilObjSessionGUI\getTabs(), ilObjCourseGUI\getTabs(), ilObjFolderGUI\getTabs(), ilObjGroupGUI\getTabs(), ilObjSAHSLearningModuleGUI\getTabs(), ilObjSurveyGUI\getTabs(), ilObjTestGUI\getTabs(), ilObjFileBasedLMGUI\getTabs(), ilObjSCORMLearningModuleGUI\offlineModeManager(), ilObjContentObjectGUI\setilLMMenu(), ilSAHSPresentationGUI\setInfoTabs(), 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 {
42 $a_user_id = $GLOBALS['ilUser']->getId();
43 }
44
45 // workaround for missing permission definitions in file object
46 $type = ilObject::_lookupType($a_ref_id, true);
47 if(
48 $type == 'file' && (
49 $a_permission == 'read_learning_progress' ||
50 $a_permission == 'edit_learning_progress'
51 )
52 ) {
53 return $GLOBALS['ilAccess']->checkAccessOfUser($a_user_id, 'write','', $a_ref_id);
54 }
55 return $GLOBALS['ilAccess']->checkAccessOfUser($a_user_id, $a_permission,'', $a_ref_id);
56 }
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
Definition: CAS.php:276

References $GLOBALS, and ilObject\_lookupType().

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 call graph for this function:
+ Here is the caller graph for this function:

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