ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjStudyProgrammeReferenceAccess Class Reference
+ Inheritance diagram for ilObjStudyProgrammeReferenceAccess:
+ Collaboration diagram for ilObjStudyProgrammeReferenceAccess:

Public Member Functions

 _checkAccess ($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id="")
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- 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 _getCommands (int $a_ref_id=null)
 
- 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

Definition at line 21 of file class.ilObjStudyProgrammeReferenceAccess.php.

Member Function Documentation

◆ _checkAccess()

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

Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

ilAccessHandler $ilAccess

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Definition at line 40 of file class.ilObjStudyProgrammeReferenceAccess.php.

References $DIC, $target_id, ilContainerReference\_lookupTargetRefId(), and ilObjStudyProgramme\getInstanceByRefId().

40  : bool
41  {
42  global $DIC;
43  $ilAccess = $DIC['ilAccess'];
44  switch ($a_permission) {
45  case 'visible':
46  case 'read':
47  $target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
48  if (!$target_ref_id || !$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
49  return false;
50  }
51  break;
52  case "delete":
53 
54  if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_ref_id)) {
55  return false;
56  }
57  $tree = $DIC['tree'];
58  $target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
59  $prg = ilObjStudyProgramme::getInstanceByRefId($target_ref_id);
60  $target_id = $prg->getId();
61  $parent = $tree->getParentNodeData($a_ref_id);
62  if ($parent["type"] === "prg" && !$parent["deleted"]) {
63  $parent = ilObjStudyProgramme::getInstanceByRefId($parent["ref_id"]);
64  if (! $parent->canBeRemoved()) {
65  return false;
66  }
67  }
68 
69  break;
70  }
71 
72  return true;
73  }
$target_id
Definition: goto.php:52
global $DIC
Definition: feed.php:28
static _lookupTargetRefId(int $a_obj_id)
+ Here is the call graph for this function:

◆ _getCommands()

static ilObjStudyProgrammeReferenceAccess::_getCommands ( int  $a_ref_id = null)
static

Definition at line 75 of file class.ilObjStudyProgrammeReferenceAccess.php.

References $DIC, ilObject\_lookupObjId(), and ilContainerReference\_lookupTargetRefId().

75  : array
76  {
77  global $DIC;
78  $ilAccess = $DIC->access();
79  $prgr_obj_id = ilObject::_lookupObjId($a_ref_id);
80  $target_ref_id = ilContainerReference::_lookupTargetRefId($prgr_obj_id);
81 
82  $commands = [];
83 
84  if ($ilAccess->checkAccess('write', '', $a_ref_id)) {
85  $commands[] = ["permission" => "write", "cmd" => "editReference", "lang_var" => "edit"];
86  }
87  if ($ilAccess->checkAccess('read', '', $target_ref_id)) {
88  $commands[] = array('permission' => 'visible', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true);
89  }
90 
91  return $commands;
92  }
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static _lookupTargetRefId(int $a_obj_id)
+ Here is the call graph for this function:

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