ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilObjBibliographicAccess Class Reference

Class ilObjBibliographicAccess. More...

+ Inheritance diagram for ilObjBibliographicAccess:
+ Collaboration diagram for ilObjBibliographicAccess:

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

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto ($a_target)
 
static _lookupOnline ($a_id)
 Check wether bibliographic is online or not. 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...
 

Static Private Member Functions

static checkEntryIdMatch ($obj_id, $entry_id)
 

Detailed Description

Member Function Documentation

◆ _checkAccess()

ilObjBibliographicAccess::_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 | string$a_user_iduser id (if not provided, current user is taken)
Returns
boolean true, if everything is ok

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

References $_GET, $DIC, $ilUser, $lng, IL_NO_OBJECT_ACCESS, IL_STATUS_MESSAGE, and ilObjBibliographicGUI\P_ENTRY_ID.

81  {
82  global $DIC;
83  $ilUser = $DIC['ilUser'];
84  $lng = $DIC['lng'];
85  $rbacsystem = $DIC['rbacsystem'];
86  $ilAccess = $DIC['ilAccess'];
87  if ($a_user_id == "") {
88  $a_user_id = $ilUser->getId();
89  }
90 
92  if (!self::checkEntryIdMatch($a_obj_id, $_GET[ilObjBibliographicGUI::P_ENTRY_ID])) {
93  return false;
94  }
95  }
96 
97  switch ($a_cmd) {
98  case "view":
99  if (!self::_lookupOnline($a_obj_id)
100  && !$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)
101  ) {
102  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
103 
104  return false;
105  }
106  break;
107  // for permission query feature
108  case "infoScreen":
109  if (!self::_lookupOnline($a_obj_id)) {
110  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
111  } else {
112  $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
113  }
114  break;
115  }
116  switch ($a_permission) {
117  case "read":
118  case "visible":
119  if (!self::_lookupOnline($a_obj_id)
120  && (!$rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id))
121  ) {
122  $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
123 
124  return false;
125  }
126  break;
127  }
128 
129  return true;
130  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
const IL_NO_OBJECT_ACCESS
const IL_STATUS_MESSAGE
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17

◆ _checkGoto()

static ilObjBibliographicAccess::_checkGoto (   $a_target)
static
Parameters
$a_target
Returns
bool

Definition at line 51 of file class.ilObjBibliographicAccess.php.

References $DIC, and $lng.

52  {
53  global $DIC;
54  $ilAccess = $DIC['ilAccess'];
55  $lng = $DIC['lng'];
56  $t_arr = explode('_', $a_target);
57  if ($t_arr[0] != 'bibl' || ((int) $t_arr[1]) <= 0) {
58  return false;
59  }
60  if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
61  return true;
62  }
63 
64  return false;
65  }
global $DIC
Definition: saml.php:7
global $lng
Definition: privfeed.php:17

◆ _getCommands()

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

References array.

Referenced by ilObjBibliographicListGUI\init().

30  {
31  $commands = array(
32  array(
33  "permission" => "read",
34  "cmd" => "render",
35  "lang_var" => "show",
36  "default" => true,
37  ),
38  array("permission" => "write", "cmd" => "view", "lang_var" => "edit_content"),
39  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings"),
40  );
41 
42  return $commands;
43  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjBibliographicAccess::_lookupOnline (   $a_id)
static

Check wether bibliographic is online or not.

Parameters
int$a_idbibl id

Definition at line 150 of file class.ilObjBibliographicAccess.php.

References $DIC, and $ilDB.

Referenced by ilObjBibliographicListGUI\getProperties().

151  {
152  global $DIC;
153  $ilDB = $DIC['ilDB'];
154  $q = "SELECT is_online FROM il_bibl_data WHERE id = " . $ilDB->quote($a_id, "integer");
155  $bibl_set = $ilDB->query($q);
156  $bibl_rec = $ilDB->fetchAssoc($bibl_set);
157 
158  return $bibl_rec["is_online"];
159  }
global $DIC
Definition: saml.php:7
global $ilDB
+ Here is the caller graph for this function:

◆ checkEntryIdMatch()

static ilObjBibliographicAccess::checkEntryIdMatch (   $obj_id,
  $entry_id 
)
staticprivate
Parameters
$obj_id
$entry_id
Returns
bool

Definition at line 139 of file class.ilObjBibliographicAccess.php.

140  {
141  return ilBibliographicEntry::exists($entry_id, $obj_id);
142  }

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