ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjStudyProgrammeAccess 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 ilObjStudyProgrammeAccess:
+ Collaboration diagram for ilObjStudyProgrammeAccess:

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 _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static getConditionOperators ()
 Get operators. More...
 
static checkCondition (int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
 
- 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 Class ilObjStudyProgrammeAccess

TODO: deletion is only allowed if there are no more users assigned to the programme.

Author
: Richard Klees richa.nosp@m.rd.k.nosp@m.lees@.nosp@m.conc.nosp@m.epts-.nosp@m.and-.nosp@m.train.nosp@m.ing..nosp@m.de

Definition at line 28 of file class.ilObjStudyProgrammeAccess.php.

Member Function Documentation

◆ _checkAccess()

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

Definition at line 30 of file class.ilObjStudyProgrammeAccess.php.

References $DIC, and ilObjStudyProgramme\getInstanceByRefId().

30  : bool
31  {
32  if ($user_id === 0 || $user_id === null) {
33  global $DIC;
34  $user_id = $DIC->user()->getId();
35  }
36 
37  if ($permission === "delete") {
39  if ($prg->hasRelevantProgresses()) {
40  return false;
41  }
42  }
43 
44  return parent::_checkAccess($cmd, $permission, $ref_id, $obj_id, $user_id);
45  }
global $DIC
Definition: feed.php:28
$ref_id
Definition: ltiauth.php:67
+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjStudyProgrammeAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Definition at line 72 of file class.ilObjStudyProgrammeAccess.php.

References $DIC.

72  : bool
73  {
74  global $DIC;
75  $ilAccess = $DIC->access();
76  $t_arr = explode('_', $target);
77  if ($t_arr[0] !== 'prg' || ((int) $t_arr[1]) <= 0) {
78  return false;
79  }
80 
81  return $ilAccess->checkAccess('read', '', (int) $t_arr[1]);
82  }
global $DIC
Definition: feed.php:28

◆ _getCommands()

static ilObjStudyProgrammeAccess::_getCommands ( )
static

get commands

this method returns an array of all possible commands/permission combinations

example: $commands = array ( array('permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show'), array('permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'edit'), );

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

Referenced by ilObjStudyProgrammeListGUI\init().

59  : array
60  {
61  $commands = [];
62  $commands[] = ['permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true];
63  $commands[] = ['permission' => 'write', 'cmd' => 'view', 'lang_var' => 'edit_content'];
64  $commands[] = [ 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings'];
65 
66  return $commands;
67  }
+ Here is the caller graph for this function:

◆ checkCondition()

static ilObjStudyProgrammeAccess::checkCondition ( int  $a_trigger_obj_id,
string  $a_operator,
string  $a_value,
int  $a_usr_id 
)
static
Parameters
int$a_trigger_obj_id
string$a_operator
string$a_value
int$a_usr_id
Returns
boolean

Implements ilConditionHandling.

Definition at line 101 of file class.ilObjStudyProgrammeAccess.php.

References ilStudyProgrammeDIC\dic(), and ilConditionHandler\OPERATOR_ACCREDITED_OR_PASSED.

106  : bool {
108  $repo = ilStudyProgrammeDIC::dic()['repo.assignment'];
109  $assignments = $repo->getAllForNodeIsContained($a_trigger_obj_id, [$a_usr_id]);
110 
111  foreach ($assignments as $ass) {
112  if ($ass->getProgressForNode($a_trigger_obj_id)->isSuccessful()) {
113  return true;
114  }
115  }
116  }
117  return false;
118  }
+ Here is the call graph for this function:

◆ getConditionOperators()

static ilObjStudyProgrammeAccess::getConditionOperators ( )
static

Get operators.

Implements ilConditionHandling.

Definition at line 87 of file class.ilObjStudyProgrammeAccess.php.

References ilConditionHandler\OPERATOR_ACCREDITED_OR_PASSED.

87  : array
88  {
89  return array(
91  );
92  }

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