ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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.

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

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

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 (
82  $olp->isActive() && (
83  $DIC->access()->checkAccess(
84  'read_learning_progress',
85  '',
86  $a_ref_id
87  ) ||
88  $DIC->access()->checkRbacOrPositionPermissionAccess(
91  $a_ref_id
92  )
93  )
94  ) {
95  return true;
96  }
97 
98  if (!$DIC->access()->checkAccess('read', '', $a_ref_id)) {
99  return false;
100  }
101  // edit learning progress is sufficient: #0029313
102  if ($DIC->access()->checkAccess(
103  'edit_learning_progress',
104  '',
105  $a_ref_id
106  )) {
107  return true;
108  }
109 
111  return false;
112  }
113 
114  if (!$olp->isActive()) {
115  return false;
116  }
117 
118  if ($a_allow_only_read) {
119  return true;
120  }
121  return false;
122  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static _lookupObjId(int $ref_id)
global $DIC
Definition: shib_login.php:25
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ 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.

References $DIC, and ilOrgUnitOperation\OP_READ_LEARNING_PROGRESS.

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().

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  }
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

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