ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 _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. 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...
 

Detailed Description

Member Function Documentation

◆ _checkAccessAdministrateUsers()

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

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

79 {
80 global $DIC;
81 $ilAccess = $DIC['ilAccess'];
82
83 if (ilUserAccountSettings::getInstance()->isLocalUserAdministrationEnabled() AND
84 $ilAccess->checkAccess('cat_administrate_users', "", $ref_id)) {
85 return true;
86 }
87
88 return false;
89 }
static getInstance()
Singelton get instance.
$ref_id
Definition: sahs_server.php:39
global $DIC

References $DIC, $ref_id, and ilUserAccountSettings\getInstance().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _checkAccessStaff()

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

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

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 }

References $DIC, and $ref_id.

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

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

61 {
62 global $DIC;
63 $ilAccess = $DIC['ilAccess'];
64
65 if (($ilAccess->checkAccess("write", "", $ref_id)
66 OR $ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id))
67 AND $ilAccess->checkAccess("read", "", $ref_id)) {
68 return true;
69 }
70
71 return false;
72 }

References $DIC, and $ref_id.

Referenced by ilOrgUnitStaffGUI\showStaffRec().

+ 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 97 of file class.ilObjOrgUnitAccess.php.

97 {
98 global $DIC;
99 $ilAccess = $DIC['ilAccess'];
100
101 //Permission to view the Learning Progress of an OrgUnit: Employees
102 if ($ilAccess->checkAccess("view_learning_progress", "", $ref_id)
103 AND in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($ref_id, false))) {
104 return true;
105 }
106 //Permission to view the Learning Progress of an OrgUnit: Superiors
107 if ($ilAccess->checkAccess("view_learning_progress", "", $ref_id)
108 AND in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getSuperiors($ref_id, false))) {
109 return true;
110 }
111
112 //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit!: Employees
113 if ($ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id)
114 AND in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($ref_id, true))) {
115 return true;
116 }
117
118 //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit!: Superiors
119 if ($ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id)
120 AND in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getSuperiors($ref_id, true))) {
121 return true;
122 }
123
124 return false;
125 }

References $DIC, $ref_id, and ilObjOrgUnitTree\_getInstance().

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

+ 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

Reimplemented from ilObjectAccess.

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

132 {
133 global $DIC;
134 $ilAccess = $DIC['ilAccess'];
135 $t_arr = explode('_', $a_target);
136 if ($t_arr[0] != 'orgu' || ((int)$t_arr[1]) <= 0) {
137 return false;
138 }
139 if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
140 return true;
141 }
142
143 return false;
144 }

References $DIC.

◆ _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'), );

Reimplemented from ilObjectAccess.

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

27 {
28 $commands = array();
29 $commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );
30// $commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);
31// $commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');
32// $commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );
33
34 return $commands;
35 }

Referenced by ilObjOrgUnitListGUI\init().

+ Here is the caller graph for this function:

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