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

Class ilObjOrgUnitAccess. More...

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

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkAccessStaff ($ref_id)
 
static _checkAccessStaffRec ($ref_id)
 
static _checkAccessAdministrateUsers ($ref_id)
 
static _checkAccessExport ($ref_id)
 
static _checkAccessToUserLearningProgress ($ref_id, $usr_id)
 
static _checkGoto ($a_target)
 check whether goto script will succeed More...
 
- 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...
 

Additional Inherited Members

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

Detailed Description

Member Function Documentation

◆ _checkAccessAdministrateUsers()

static ilObjOrgUnitAccess::_checkAccessAdministrateUsers (   $ref_id)
static
Parameters
integer$ref_id
Returns
bool

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

References $DIC, and ilUserAccountSettings\getInstance().

Referenced by ilObjOrgUnitGUI\executeCommand().

81  {
82  global $DIC;
83  $ilAccess = $DIC['ilAccess'];
84 
85  if (ilUserAccountSettings::getInstance()->isLocalUserAdministrationEnabled() and
86  $ilAccess->checkAccess('cat_administrate_users', "", $ref_id)) {
87  return true;
88  }
89 
90  return false;
91  }
global $DIC
Definition: saml.php:7
static getInstance()
Singelton get instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkAccessExport()

static ilObjOrgUnitAccess::_checkAccessExport (   $ref_id)
static
Parameters
integer$ref_id
Returns
bool

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

References $DIC.

Referenced by ilObjOrgUnitGUI\executeCommand().

99  {
100  global $DIC;
101  $ilAccess = $DIC['ilAccess'];
102 
103  if ($ilAccess->checkAccess('write', '', $ref_id)) {
104  return true;
105  }
106 
107  return false;
108  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _checkAccessStaff()

static ilObjOrgUnitAccess::_checkAccessStaff (   $ref_id)
static
Parameters
integer$ref_id
Returns
bool

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

References $DIC.

Referenced by ilObjOrgUnitGUI\getTabs(), and ilOrgUnitStaffGUI\showStaff().

43  {
44  global $DIC;
45  $ilAccess = $DIC['ilAccess'];
46 
47  if (($ilAccess->checkAccess("write", "", $ref_id)
48  or $ilAccess->checkAccess("view_learning_progress", "", $ref_id))
49  and $ilAccess->checkAccess("read", "", $ref_id)) {
50  return true;
51  }
52 
53  return false;
54  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _checkAccessStaffRec()

static ilObjOrgUnitAccess::_checkAccessStaffRec (   $ref_id)
static
Parameters
integer$ref_id
Returns
bool

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

References $DIC.

Referenced by ilOrgUnitStaffGUI\showStaffRec().

62  {
63  global $DIC;
64  $ilAccess = $DIC['ilAccess'];
65 
66  if (($ilAccess->checkAccess("write", "", $ref_id)
67  or $ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id))
68  and $ilAccess->checkAccess("read", "", $ref_id)) {
69  return true;
70  }
71 
72  return false;
73  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _checkAccessToUserLearningProgress()

static ilObjOrgUnitAccess::_checkAccessToUserLearningProgress (   $ref_id,
  $usr_id 
)
static
Parameters
integer$ref_id
integer$usr_id
Returns
bool

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

References $DIC, and ilObjOrgUnitTree\_getInstance().

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

117  {
118  global $DIC;
119  $ilAccess = $DIC['ilAccess'];
120 
121  //Permission to view the Learning Progress of an OrgUnit: Employees
122  if ($ilAccess->checkAccess("view_learning_progress", "", $ref_id)
123  and in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($ref_id, false))) {
124  return true;
125  }
126  //Permission to view the Learning Progress of an OrgUnit: Superiors
127  if ($ilAccess->checkAccess("view_learning_progress", "", $ref_id)
128  and in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getSuperiors($ref_id, false))) {
129  return true;
130  }
131 
132  //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit!: Employees
133  if ($ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id)
134  and in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($ref_id, true))) {
135  return true;
136  }
137 
138  //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit!: Superiors
139  if ($ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id)
140  and in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getSuperiors($ref_id, true))) {
141  return true;
142  }
143 
144  return false;
145  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkGoto()

static ilObjOrgUnitAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

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

References $DIC.

152  {
153  global $DIC;
154  $ilAccess = $DIC['ilAccess'];
155  $t_arr = explode('_', $a_target);
156  if ($t_arr[0] != 'orgu' || ((int) $t_arr[1]) <= 0) {
157  return false;
158  }
159  if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
160  return true;
161  }
162 
163  return false;
164  }
global $DIC
Definition: saml.php:7

◆ _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 25 of file class.ilObjOrgUnitAccess.php.

Referenced by ilObjOrgUnitListGUI\init().

26  {
27  $commands = array();
28  $commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );
29  // $commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);
30  // $commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');
31  // $commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );
32 
33  return $commands;
34  }
+ Here is the caller graph for this function:

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