ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 25 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 60 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().

63  : bool {
64  global $DIC;
65 
66  if ($DIC->user()->getId() == ANONYMOUS_USER_ID) {
67  return false;
68  }
69 
71  return false;
72  }
73 
75  if (
76  $olp->isActive() && (
77  $DIC->access()->checkAccess(
78  'read_learning_progress',
79  '',
80  $a_ref_id
81  ) ||
82  $DIC->access()->checkRbacOrPositionPermissionAccess(
85  $a_ref_id
86  )
87  )
88  ) {
89  return true;
90  }
91 
92  if (!$DIC->access()->checkAccess('read', '', $a_ref_id)) {
93  return false;
94  }
95  // edit learning progress is sufficient: #0029313
96  if ($DIC->access()->checkAccess(
97  'edit_learning_progress',
98  '',
99  $a_ref_id
100  )) {
101  return true;
102  }
103 
105  return false;
106  }
107 
108  if (!$olp->isActive()) {
109  return false;
110  }
111 
112  if ($a_allow_only_read) {
113  return true;
114  }
115  return false;
116  }
const ANONYMOUS_USER_ID
Definition: constants.php:27
static _lookupObjId(int $ref_id)
global $DIC
Definition: shib_login.php:22
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 30 of file class.ilLearningProgressAccess.php.

References $DIC, null, 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().

34  : bool {
35  global $DIC;
36 
37  if ($a_user_id === null) {
38  $a_user_id = $DIC->user()->getId();
39  }
40 
41  // position access
42  if ($a_permission === 'read_learning_progress') {
43  return $DIC->access()->checkRbacOrPositionPermissionAccess(
46  $a_ref_id
47  );
48  }
49  return $DIC->access()->checkAccessOfUser(
50  $a_user_id,
51  $a_permission,
52  '',
53  $a_ref_id
54  );
55  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

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