ILIAS  release_7 Revision v7.30-3-g800a261c036
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 wether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 _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...
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ($a_ref_id=null)
 
- 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

Definition at line 3 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 wether 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.

@global 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

Reimplemented from ilContainerReferenceAccess.

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

23 {
24 global $DIC;
25 $ilAccess = $DIC['ilAccess'];
26 switch ($a_permission) {
27 case 'visible':
28 case 'read':
29 $target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
30 if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
31 return false;
32 }
33 break;
34 case "delete":
35
36 if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_ref_id)) {
37 return false;
38 }
39 $tree = $DIC['tree'];
40 $assignment_ids = [];
41 $target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
42 $prg = ilObjStudyProgramme::getInstanceByRefId($target_ref_id);
43 $target_id = $prg->getId();
44 $progress_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserProgressDB'];
45 $parent = $tree->getParentNodeData($a_ref_id);
46 if ($parent["type"] === "prg" && !$parent["deleted"]) {
47 $parent = ilObjStudyProgramme::getInstanceByRefId($parent["ref_id"]);
48 foreach ($parent->getProgresses() as $parent_progress
49 ) {
50 $progress = $progress_db->getByPrgIdAndAssignmentId(
52 $parent_progress->getAssignmentId()
53 );
54
55 if (!$progress) {
56 continue;
57 }
58 if ($progress->isRelevant()) {
59 return false;
60 }
61 }
62 }
63
64 break;
65 }
66
67 return true;
68 }
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static getInstanceByRefId($a_ref_id)
global $DIC
Definition: goto.php:24
$target_id
Definition: goto.php:51

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

+ Here is the call graph for this function:

◆ _getCommands()

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

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

71 {
72 global $DIC;
73 $ilAccess = $DIC->access();
74 $prgr_obj_id = ilObject::_lookupObjId($a_ref_id);
75 $target_ref_id = ilContainerReference::_lookupTargetRefId($prgr_obj_id);
76
77 $commands = [];
78
79 if ($ilAccess->checkAccess('write', '', $a_ref_id)) {
80 $commands[] = ["permission" => "write", "cmd" => "editReference", "lang_var" => "edit"];
81 }
82 if ($ilAccess->checkAccess('read', '', $target_ref_id)) {
83 $commands[] = array('permission' => 'visible', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true);
84 }
85
86 return $commands;
87 }
static _lookupObjId($a_id)

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

+ Here is the call graph for this function:

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