ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed 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...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. 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 17 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 33 of file class.ilObjStudyProgrammeAccess.php.

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

References $ilUser, and ilObjStudyProgramme\getInstanceByRefId().

+ Here is the call graph for this function:

◆ _checkGoto()

ilObjStudyProgrammeAccess::_checkGoto (   $a_target)

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

77 {
78 global $ilAccess;
79 $t_arr = explode('_', $a_target);
80 if ($t_arr[0] != 'prg' || ((int)$t_arr[1]) <= 0) {
81 return false;
82 }
83 if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
84 return true;
85 }
86
87 return false;
88 }

◆ _getCommands()

ilObjStudyProgrammeAccess::_getCommands ( )

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

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

Referenced by ilObjStudyProgrammeListGUI\init().

+ Here is the caller graph for this function:

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