ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjCourseReferenceAccess Class Reference
+ Inheritance diagram for ilObjCourseReferenceAccess:
+ Collaboration diagram for ilObjCourseReferenceAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 
- Public Member Functions inherited from ilContainerReferenceAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
Parameters
ilWACPath$ilWACPath
Returns
bool
More...
 

Static Public Member Functions

static _preloadData ($a_obj_ids, $a_ref_ids)
 
static _getCommands ($a_ref_id=0)
 
- Static Public Member Functions inherited from ilContainerReferenceAccess
static _isAccessible ($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 ($a_target)
 check whether goto script will succeed More...
 
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Detailed Description

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

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

Member Function Documentation

◆ _checkAccess()

ilObjCourseReferenceAccess::_checkAccess (   $a_cmd,
  $a_permission,
  $a_ref_id,
  $a_obj_id,
  $a_user_id = "" 
)

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

References $DIC, and ilContainerReference\_lookupTargetRefId().

42  {
43  global $DIC;
44 
45  switch ($a_permission) {
46  case 'visible':
47  case 'read':
48  include_once './Modules/CourseReference/classes/class.ilObjCourseReference.php';
49  $target_ref_id = ilObjCourseReference::_lookupTargetRefId($a_obj_id);
50 
51  if (!$DIC->access()->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
52  return false;
53  }
54  break;
55  }
56 
57  return true;
58  }
global $DIC
Definition: saml.php:7
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
+ Here is the call graph for this function:

◆ _getCommands()

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

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

References $DIC, and ilObjCourseAccess\_getCommands().

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

◆ _preloadData()

static ilObjCourseReferenceAccess::_preloadData (   $a_obj_ids,
  $a_ref_ids 
)
static

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

References $DIC, and ilContainerReference\_lookupTargetId().

64  {
65  global $DIC;
66 
67  $repository = new ilUserCertificateRepository();
68  $coursePreload = new ilCertificateObjectsForUserPreloader($repository);
69  $coursePreload->preLoad($DIC->user()->getId(), array_map(function ($objId) {
70  return (int) \ilObjCourseReference::_lookupTargetId($objId);
71  }, $a_obj_ids));
72  }
global $DIC
Definition: saml.php:7
static _lookupTargetId($a_obj_id)
lookup target id
+ Here is the call graph for this function:

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