ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilObjStudyProgrammeAccess.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2015 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
5 require_once('./Services/Object/classes/class.ilObjectAccess.php');
6 require_once('./Services/User/classes/class.ilUserAccountSettings.php');
7 
33  function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id = "")
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  }
50 
63  public function _getCommands()
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  }
72 
76  function _checkGoto($a_target)
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  }
89 }
90 
91 ?>
_checkGoto($a_target)
check whether goto script will succeed
Class 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::checkAcce...
static getInstanceByRefId($a_ref_id)
Get an instance of ilObjStudyProgramme, use cache.
global $ilUser
Definition: imgupload.php:15
Class ilObjectAccess.