ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilObjOrgUnitAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilObjOrgUnitAccess:
+ Collaboration diagram for ilObjOrgUnitAccess:

Static Public Member Functions

static _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'), ); More...
 
static _checkAccessStaff (int $ref_id)
 
static _checkAccessSettings (int $ref_id)
 
static _checkAccessExport (int $ref_id)
 
static _checkAccessTypes (int $ref_id)
 
static _checkAccessPositions (int $ref_id)
 
static _checkAccessStaffRec (int $ref_id)
 
static _checkAccessAdministrateUsers (int $ref_id)
 
static _checkAccessToUserLearningProgress (int $ref_id, int $usr_id)
 
static _checkGoto (string $a_target)
 
- 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...
 

Additional Inherited Members

- 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)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjOrgUnitAccess

Author
: Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
: Martin Studer ms@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 26 of file class.ilObjOrgUnitAccess.php.

Member Function Documentation

◆ _checkAccessAdministrateUsers()

static ilObjOrgUnitAccess::_checkAccessAdministrateUsers ( int  $ref_id)
static

Definition at line 98 of file class.ilObjOrgUnitAccess.php.

References $DIC, and ilUserAccountSettings\getInstance().

Referenced by ilObjOrgUnitGUI\executeCommand(), and ilObjOrgUnitGUI\getTabs().

98  : bool
99  {
100  global $DIC;
101 
102  return ilUserAccountSettings::getInstance()->isLocalUserAdministrationEnabled()
103  && $DIC->access()->checkAccess('cat_administrate_users', '', $ref_id);
104  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkAccessExport()

static ilObjOrgUnitAccess::_checkAccessExport ( int  $ref_id)
static

Definition at line 68 of file class.ilObjOrgUnitAccess.php.

References $DIC.

Referenced by ilObjOrgUnitGUI\executeCommand().

68  : bool
69  {
70  global $DIC;
71 
72  return $DIC->access()->checkAccess('write', '', $ref_id);
73  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ _checkAccessPositions()

static ilObjOrgUnitAccess::_checkAccessPositions ( int  $ref_id)
static

Definition at line 82 of file class.ilObjOrgUnitAccess.php.

References $DIC.

Referenced by ilOrgUnitPositionGUI\__construct(), and ilOrgUnitUserAssignmentGUI\executeCommand().

82  : bool
83  {
84  global $DIC;
85 
86  return $DIC->access()->checkAccess('write', '', $ref_id);
87  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ _checkAccessSettings()

static ilObjOrgUnitAccess::_checkAccessSettings ( int  $ref_id)
static

Definition at line 61 of file class.ilObjOrgUnitAccess.php.

References $DIC.

Referenced by ilOrgUnitGlobalSettingsGUI\__construct(), and ilObjOrgUnitGUI\getTabs().

61  : bool
62  {
63  global $DIC;
64 
65  return $DIC->access()->checkAccess('write', '', $ref_id);
66  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ _checkAccessStaff()

static ilObjOrgUnitAccess::_checkAccessStaff ( int  $ref_id)
static

Definition at line 52 of file class.ilObjOrgUnitAccess.php.

References $DIC.

Referenced by ilOrgUnitUserAssignmentGUI\assignmentsRecursive(), ilOrgUnitUserAssignmentGUI\executeCommand(), and ilObjOrgUnitGUI\getTabs().

52  : bool
53  {
54  global $DIC;
55 
56  return ($DIC->access()->checkAccess('write', '', $ref_id)
57  || $DIC->access()->checkAccess('view_learning_progress', '', $ref_id))
58  && $DIC->access()->checkAccess('read', '', $ref_id);
59  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ _checkAccessStaffRec()

static ilObjOrgUnitAccess::_checkAccessStaffRec ( int  $ref_id)
static

Definition at line 89 of file class.ilObjOrgUnitAccess.php.

References $DIC.

Referenced by ilOrgUnitUserAssignmentGUI\assignmentsRecursive().

89  : bool
90  {
91  global $DIC;
92 
93  return ($DIC->access()->checkAccess('write', '', $ref_id)
94  || $DIC->access()->checkAccess('view_learning_progress_rec', '', $ref_id))
95  && $DIC->access()->checkAccess('read', '', $ref_id);
96  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the caller graph for this function:

◆ _checkAccessToUserLearningProgress()

static ilObjOrgUnitAccess::_checkAccessToUserLearningProgress ( int  $ref_id,
int  $usr_id 
)
static

Definition at line 106 of file class.ilObjOrgUnitAccess.php.

References $DIC, and ilObjOrgUnitTree\_getInstance().

Referenced by ilLPListOfProgressGUI\__initUser(), and ilObjOrgUnitGUI\executeCommand().

106  : bool
107  {
108  global $DIC;
109 
110  //Permission to view the Learning Progress of an OrgUnit: Employees
111  if ($DIC->access()->checkAccess('view_learning_progress', '', $ref_id)
112  && in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($ref_id, false))
113  ) {
114  return true;
115  }
116  //Permission to view the Learning Progress of an OrgUnit: Superiors
117  if ($DIC->access()->checkAccess('view_learning_progress', '', $ref_id)
118  && in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getSuperiors($ref_id, false))
119  ) {
120  return true;
121  }
122 
123  //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit!: Employees
124  if ($DIC->access()->checkAccess('view_learning_progress_rec', '', $ref_id)
125  && in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($ref_id, true))
126  ) {
127  return true;
128  }
129 
130  //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit!: Superiors
131  if ($DIC->access()->checkAccess('view_learning_progress_rec', '', $ref_id)
132  && in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getSuperiors($ref_id, true))
133  ) {
134  return true;
135  }
136 
137  return false;
138  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkAccessTypes()

static ilObjOrgUnitAccess::_checkAccessTypes ( int  $ref_id)
static

Definition at line 75 of file class.ilObjOrgUnitAccess.php.

References $DIC.

75  : bool
76  {
77  global $DIC;
78 
79  return $DIC->access()->checkAccess('write', '', $ref_id);
80  }
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25

◆ _checkGoto()

static ilObjOrgUnitAccess::_checkGoto ( string  $a_target)
static

Definition at line 141 of file class.ilObjOrgUnitAccess.php.

References $DIC.

141  : bool
142  {
143  global $DIC;
144 
145  $t_arr = explode('_', $a_target);
146  if ($t_arr[0] !== 'orgu' || ((int) $t_arr[1]) <= 0) {
147  return false;
148  }
149  if ($DIC->access()->checkAccess('read', '', $t_arr[1])) {
150  return true;
151  }
152 
153  return false;
154  }
global $DIC
Definition: shib_login.php:25

◆ _getCommands()

static ilObjOrgUnitAccess::_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'), );

Definition at line 38 of file class.ilObjOrgUnitAccess.php.

Referenced by ilObjOrgUnitListGUI\init().

38  : array
39  {
40  $commands = [
41  [
42  'permission' => 'read',
43  'cmd' => 'view',
44  'lang_var' => 'show',
45  'default' => true,
46  ],
47  ];
48 
49  return $commands;
50  }
+ Here is the caller graph for this function:

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