ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  static 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  static function _checkGoto($a_target)
77  {
78  global $DIC;
79  $ilAccess = $DIC['ilAccess'];
80  $t_arr = explode('_', $a_target);
81  if ($t_arr[0] != 'prg' || ((int)$t_arr[1]) <= 0) {
82  return false;
83  }
84  if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
85  return true;
86  }
87 
88  return false;
89  }
90 }
91 
92 ?>
Class ilObjStudyProgrammeAccess.
static _checkGoto($a_target)
check whether goto script will succeed
_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.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
Class ilObjectAccess.
global $DIC