ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
30 $target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
31 if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $target_ref_id)) {
32 return false;
33 }
34 break;
35 case "delete":
36
37 if (!$ilAccess->checkAccessOfUser($a_user_id, $a_permission, $a_cmd, $a_ref_id)) {
38 return false;
39 }
40 $tree = $DIC['tree'];
41 $assignment_ids = [];
42 $target_ref_id = ilContainerReference::_lookupTargetRefId($a_obj_id);
43 $prg = ilObjStudyProgramme::getInstanceByRefId($target_ref_id);
44 $target_id = $prg->getId();
45 $progress_db = ilStudyProgrammeDIC::dic()['ilStudyProgrammeUserProgressDB'];
46 $parent = $tree->getParentNodeData($a_ref_id);
47 if ($parent["type"] === "prg" && !$parent["deleted"]) {
48 $parent = ilObjStudyProgramme::getInstanceByRefId($parent["ref_id"]);
49 foreach ($parent->getProgresses() as $parent_progress
50 ) {
51 try {
52 $progress =
53 $progress_db->getInstanceForAssignment(
55 $parent_progress->getAssignmentId()
56 );
58 continue;
59 }
60 if ($progress->isRelevant()) {
61 return false;
62 }
63 }
64 }
65
66 break;
67 }
68
69 return true;
70 }
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static getInstanceByRefId($a_ref_id)
Exception is thrown when a progress for some programme node and assignment is missing.
$target_id
Definition: goto.php:49
$DIC
Definition: xapitoken.php:46

References $DIC, Vendor\Package\$e, $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 72 of file class.ilObjStudyProgrammeReferenceAccess.php.

73 {
74 global $DIC;
75
76 $ilAccess = $DIC->access();
77
78 if ($ilAccess->checkAccess('write', '', $a_ref_id)) {
79 // Only local (reference specific commands)
80 $commands = [
81 ["permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true]
82 ,["permission" => "write", "cmd" => "view", "lang_var" => "edit_content"]
83 ,["permission" => "write", "cmd" => "edit", "lang_var" => "settings"]
84 ,["permission" => "write", "cmd" => "editReference", "lang_var" => "edit"]
85 ];
86 } else {
88 }
89 return $commands;
90 }

References $DIC, and ilObjStudyProgrammeAccess\_getCommands().

+ Here is the call graph for this function:

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