ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjDataCollectionAccess Class Reference

Class ilObjDataCollectionAccess. More...

+ Inheritance diagram for ilObjDataCollectionAccess:
+ Collaboration diagram for ilObjDataCollectionAccess:

Public Member Functions

 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _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...
 
 _lookupOnline ($a_id)
 Check wether datacollection is online. More...
 
- 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=0)
 check condition More...
 
 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 check whether goto script will succeed More...
 
 _preloadData ($a_obj_ids, $a_ref_ids)
 Preload data. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectAccess
static _isOffline ($a_obj_id)
 Type-specific implementation of general status, has to be overwritten. More...
 

Detailed Description

Member Function Documentation

◆ _checkAccess()

ilObjDataCollectionAccess::_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)

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 75 of file class.ilObjDataCollectionAccess.php.

References $ilUser, $lng, _lookupOnline(), and IL_NO_OBJECT_ACCESS.

76  {
77  global $ilUser, $lng, $rbacsystem, $ilAccess;
78 
79  if ($a_user_id == "")
80  {
81  $a_user_id = $ilUser->getId();
82  }
83  switch ($a_cmd)
84  {
85  case "view":
86 
88  && !$rbacsystem->checkAccessOfUser($a_user_id,'write',$a_ref_id))
89  {
90  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
91  return false;
92  }
93  break;
94 
95  // for permission query feature
96  case "infoScreen":
98  {
99  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
100  }
101  else
102  {
103  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
104  }
105  break;
106 
107  }
108  switch($a_permission)
109  {
110  case "read":
111  case "visible":
113  (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)))
114  {
115  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
116  return false;
117  }
118  break;
119  }
120 
121  return true;
122  }
const IL_NO_OBJECT_ACCESS
_lookupOnline($a_id)
Check wether datacollection is online.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ _checkGoto()

ilObjDataCollectionAccess::_checkGoto (   $a_target)

check whether goto script will succeed

Definition at line 46 of file class.ilObjDataCollectionAccess.php.

47  {
48  global $ilAccess;
49 
50  $t_arr = explode("_", $a_target);
51 
52  if ($t_arr[0] != "dcl" || ((int) $t_arr[1]) <= 0)
53  {
54  return false;
55  }
56 
57  if ($ilAccess->checkAccess("read", "", $t_arr[1])) {
58  return true;
59  }
60  return false;
61  }

◆ _getCommands()

ilObjDataCollectionAccess::_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"), );

Definition at line 31 of file class.ilObjDataCollectionAccess.php.

Referenced by ilObjDataCollectionListGUI\init().

32  {
33  $commands = array
34  (
35  array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true),
36  array("permission" => "write", "cmd" => "listRecords", "lang_var" => "edit_content"),
37  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
38  );
39 
40  return $commands;
41  }
+ Here is the caller graph for this function:

◆ _lookupOnline()

ilObjDataCollectionAccess::_lookupOnline (   $a_id)

Check wether datacollection is online.

Parameters
int$a_idwiki id

Definition at line 129 of file class.ilObjDataCollectionAccess.php.

Referenced by _checkAccess(), and ilObjDataCollectionListGUI\getProperties().

130  {
131  global $ilDB;
132 
133  $q = "SELECT * FROM il_dcl_data WHERE id = ".
134  $ilDB->quote($a_id, "integer");
135  $dcl_set = $ilDB->query($q);
136  $dcl_rec = $ilDB->fetchAssoc($dcl_set);
137 
138  return $dcl_rec["is_online"];
139  }
+ Here is the caller graph for this function:

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