ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjCourseReferenceAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjCourseReferenceAccess:
+ Collaboration diagram for ilObjCourseReferenceAccess:

Public Member Functions

 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _preloadData (array $obj_ids, array $ref_ids)
 
static _getCommands ($a_ref_id=0)
 
- Static Public Member Functions inherited from ilContainerReferenceAccess
static _isAccessible (int $a_ref_id)
 Check if target is accessible and not deleted. More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 31 of file class.ilObjCourseReferenceAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjCourseReferenceAccess::_checkAccess ( string  $cmd,
string  $permission,
int  $ref_id,
int  $obj_id,
?int  $user_id = null 
)

Definition at line 36 of file class.ilObjCourseReferenceAccess.php.

References $DIC, and ilContainerReference\_lookupTargetRefId().

36  : bool
37  {
38  global $DIC;
39 
40  switch ($permission) {
41  case 'visible':
42  case 'read':
43  case 'edit_learning_progress':
44  include_once './Modules/CourseReference/classes/class.ilObjCourseReference.php';
45  $target_ref_id = ilObjCourseReference::_lookupTargetRefId($obj_id);
46 
47  if (!$target_ref_id || !$DIC->access()->checkAccessOfUser($user_id, $permission, $cmd, $target_ref_id)) {
48  return false;
49  }
50  break;
51  }
52 
53  return true;
54  }
global $DIC
Definition: feed.php:28
static _lookupTargetRefId(int $a_obj_id)
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjCourseReferenceAccess::_getCommands (   $a_ref_id = 0)
static

Definition at line 73 of file class.ilObjCourseReferenceAccess.php.

References $DIC, and ilObjCourseAccess\_getCommands().

73  : array
74  {
75  global $DIC;
76 
77  if ($DIC->access()->checkAccess('write', '', $a_ref_id)) {
78  // Only local (reference specific commands)
79  $commands = array(
80  array("permission" => "visible", "cmd" => "", "lang_var" => "show","default" => true),
81  array("permission" => "write", "cmd" => "editReference", "lang_var" => "edit")
82  );
83  } else {
84  include_once('./Modules/Course/classes/class.ilObjCourseAccess.php');
85  $commands = ilObjCourseAccess::_getCommands();
86  }
87  return $commands;
88  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ _preloadData()

static ilObjCourseReferenceAccess::_preloadData ( array  $obj_ids,
array  $ref_ids 
)
static

Definition at line 59 of file class.ilObjCourseReferenceAccess.php.

References $DIC, $objId, and ilContainerReference\_lookupTargetId().

59  : void
60  {
61  global $DIC;
62 
63  $repository = new ilUserCertificateRepository();
64  $coursePreload = new ilCertificateObjectsForUserPreloader($repository);
65  $coursePreload->preLoad($DIC->user()->getId(), array_map(function ($objId) {
67  }, $obj_ids));
68  }
$objId
Definition: xapitoken.php:57
global $DIC
Definition: feed.php:28
static _lookupTargetId(int $a_obj_id)
+ Here is the call graph for this function:

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