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

Class ilObjectAccess. More...

+ Inheritance diagram for ilObjectAccess:
+ Collaboration diagram for ilObjectAccess:

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Class ilObjectAccess.

This class contains methods that check object specific conditions for access to objects. Every object type should provide an inherited class called ilObj<TypeName>Access

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 16 of file class.ilObjectAccess.php.

Member Function Documentation

◆ _checkAccess()

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)

Please do not check any preconditions handled by ilConditionHandler here. Also don't do any RBAC checks.

Parameters
string$a_cmdcommand (not permission!)
string$a_permissionpermission
int$a_ref_idreference id
int$a_obj_idobject id
int$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

Definition at line 33 of file class.ilObjectAccess.php.

34  {
35 
36  // add no access info item and return false if access is not granted
37  // $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $a_text, $a_data = "");
38  //
39  // for all RBAC checks use checkAccessOfUser instead the normal checkAccess-method:
40  // $rbacsystem->checkAccessOfUser($a_user_id, $a_permission, $a_ref_id)
41 
42  return true;
43  }

◆ _checkCondition()

ilObjectAccess::_checkCondition (   $a_obj_id,
  $a_operator,
  $a_value,
  $a_usr_id 
)

check condition

this method is called by ilConditionHandler

Definition at line 50 of file class.ilObjectAccess.php.

51  {
52  switch ($a_operator) {
53  default:
54  return true;
55  }
56  }

◆ _checkGoto()

static ilObjectAccess::_checkGoto (   $a_target)
static

check whether goto script will succeed

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

References $DIC.

83  {
84  global $DIC;
85 
86  $ilAccess = $DIC->access();
87 
88  $t_arr = explode("_", $a_target);
89 
90  if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
91  return true;
92  }
93  return false;
94  }
global $DIC
Definition: saml.php:7

◆ _getCommands()

static ilObjectAccess::_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 70 of file class.ilObjectAccess.php.

Referenced by ilObjectListGUI\init(), ilObjSAHSLearningModuleListGUI\initItem(), ilObjGroupReferenceListGUI\initItem(), ilObjCourseReferenceListGUI\initItem(), and ilObjCategoryReferenceListGUI\initItem().

71  {
72  $commands = array(
73  array()
74  );
75 
76  return $commands;
77  }
+ Here is the caller graph for this function:

◆ _isOffline()

static ilObjectAccess::_isOffline (   $a_obj_id)
static

Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling.

Used in ListGUI and Learning Progress

Parameters
int$a_obj_id
Returns
bool

Definition at line 105 of file class.ilObjectAccess.php.

References $DIC, ilObject\_lookupType(), and ilObject\lookupOfflineStatus().

106  {
107  global $DIC;
108 
109  $objDefinition = $DIC['objDefinition'];
110  if ($objDefinition->supportsOfflineHandling(ilObject::_lookupType($a_obj_id))) {
111  return ilObject::lookupOfflineStatus($a_obj_id);
112  }
113  return null;
114  }
global $DIC
Definition: saml.php:7
static lookupOfflineStatus($a_obj_id)
Lookup offline status using objectDataCache.
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:

◆ _preloadData()

static ilObjectAccess::_preloadData (   $a_obj_ids,
  $a_ref_ids 
)
static

Preload data.

Parameters
array$a_obj_idsarray of object ids

Definition at line 121 of file class.ilObjectAccess.php.

122  {
123  }

◆ canBeDelivered()

ilObjectAccess::canBeDelivered ( ilWACPath  $ilWACPath)

Parameters
ilWACPath$ilWACPath
Returns
bool

Implements ilWACCheckingClass.

Definition at line 128 of file class.ilObjectAccess.php.

References $results, ilObject2\_getAllReferences(), and ilWACPath\getPath().

129  {
130  global $ilAccess;
131 
132  preg_match("/\\/obj_([\\d]*)\\//uism", $ilWACPath->getPath(), $results);
133  foreach (ilObject2::_getAllReferences($results[1]) as $ref_id) {
134  if ($ilAccess->checkAccess('visible', '', $ref_id) || $ilAccess->checkAccess('read', '', $ref_id)) {
135  return true;
136  }
137  }
138 
139  return false;
140  }
static _getAllReferences($a_id)
$results
Definition: svg-scanner.php:47
+ Here is the call graph for this function:

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