ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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

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

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  }
global $DIC
Definition: saml.php:7
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _lookupObjId($a_id)
static getInstance($a_obj_id)
+ 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.

References $GLOBALS.

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

39  {
40  if (is_null($a_user_id)) {
41  $a_user_id = $GLOBALS['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['ilAccess']->checkAccessOfUser($a_user_id, $a_permission, '', $a_ref_id);
53  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ Here is the caller graph for this function:

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