ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjStudyProgrammeAccess Class Reference

Class ilObjStudyProgrammeAccess. 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)
 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)
 
 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...
 
static getConditionOperators ()
 Returns an array with valid operators for the specific object type. More...
 
static checkCondition (int $a_trigger_obj_id, string $a_operator, string $a_value, int $a_usr_id)
 check condition for a specific user and object More...
 

Detailed Description

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 
)

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.

Reimplemented from ilObjectAccess.

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

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 }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:26

References $DIC, $ref_id, $user_id, and ilObjStudyProgramme\getInstanceByRefId().

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjStudyProgrammeAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

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 }

References $DIC.

◆ _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'), );

Reimplemented from ilObjectAccess.

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

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 }

Referenced by ilObjStudyProgrammeListGUI\init().

+ 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.

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 }
const string OPERATOR_ACCREDITED_OR_PASSED

References ilStudyProgrammeDIC\dic().

+ 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.

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

References ilConditionHandler\OPERATOR_ACCREDITED_OR_PASSED.


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