ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjStudyProgrammeAccess Class Reference

Class ilObjStudyProgrammeAccess. More...

+ Inheritance diagram for ilObjStudyProgrammeAccess:
+ Collaboration diagram for ilObjStudyProgrammeAccess:

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...
 
- 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 ()
 get commands More...
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
static getConditionOperators ()
 Get operators. More...
 
static checkCondition ($a_obj_id, $a_operator, $a_value, $a_usr_id)
 
- 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...
 
static getConditionOperators ()
 Returns an array with valid operators for the specific object type. More...
 
static checkCondition ($a_trigger_obj_id, $a_operator, $a_value, $a_usr_id)
 check condition for a specific user and object More...
 

Detailed Description

Class ilObjStudyProgrammeAccess.

TODO: deletion is only allowed if there are now 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 19 of file class.ilObjStudyProgrammeAccess.php.

Member Function Documentation

◆ _checkAccess()

ilObjStudyProgrammeAccess::_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.

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

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

38 {
39 if ($a_user_id == "") {
40 $a_user_id = $ilUser->getId();
41 }
42
43 if ($a_permission == "delete") {
44 require_once("Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
46 if ($prg->hasRelevantProgresses()) {
47 return false;
48 }
49 }
50
51 return parent::_checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "");
52 }
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
$ilUser
Definition: imgupload.php:18

References $ilUser, and ilObjStudyProgramme\getInstanceByRefId().

+ Here is the call graph for this function:

◆ _checkGoto()

static ilObjStudyProgrammeAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

80 {
81 global $DIC;
82 $ilAccess = $DIC['ilAccess'];
83 $t_arr = explode('_', $a_target);
84 if ($t_arr[0] != 'prg' || ((int) $t_arr[1]) <= 0) {
85 return false;
86 }
87 if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
88 return true;
89 }
90
91 return false;
92 }
global $DIC
Definition: saml.php:7

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 66 of file class.ilObjStudyProgrammeAccess.php.

67 {
68 $commands = array();
69 $commands[] = array('permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true);
70 $commands[] = array('permission' => 'write', 'cmd' => 'view', 'lang_var' => 'edit_content');
71 $commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings');
72
73 return $commands;
74 }

Referenced by ilObjStudyProgrammeListGUI\init().

+ Here is the caller graph for this function:

◆ checkCondition()

static ilObjStudyProgrammeAccess::checkCondition (   $a_obj_id,
  $a_operator,
  $a_value,
  $a_usr_id 
)
static
Parameters
type$a_obj_id
type$a_operator
type$a_value
type$a_usr_id
Returns
boolean

Implements ilConditionHandling.

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

113 {
115 $valid_progress = array(
118 );
119
120 $prg_user_progress = ilObjStudyProgramme::_getStudyProgrammeUserProgressDB()->getInstancesForUser($a_obj_id, $a_usr_id);
121 foreach ($prg_user_progress as $progress) {
122 if (in_array($progress->getStatus(), $valid_progress)) {
123 return true;
124 }
125 }
126 }
127 return false;
128 }
static _getStudyProgrammeUserProgressDB()
Get an instance of ilStudyProgrammeUserProgressDB.

References ilObjStudyProgramme\_getStudyProgrammeUserProgressDB(), ilConditionHandler\OPERATOR_ACCREDITED_OR_PASSED, ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_COMPLETED.

+ Here is the call graph for this function:

◆ getConditionOperators()

static ilObjStudyProgrammeAccess::getConditionOperators ( )
static

Get operators.

Implements ilConditionHandling.

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

98 {
99 return array(
101 );
102 }

References ilConditionHandler\OPERATOR_ACCREDITED_OR_PASSED.


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