ILIAS  release_4-4 Revision
ilObjBibliographicAccess Class Reference

Class ilObjBibliographicAccess. More...

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

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

Static Public Member Functions

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

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

References $ilUser, $lng, 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 
84  switch ($a_cmd)
85  {
86  case "view":
87  if(!self::_lookupOnline($a_obj_id)
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":
97  if(!self::_lookupOnline($a_obj_id))
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":
112  if (!self::_lookupOnline($a_obj_id) &&
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
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40

◆ _checkGoto()

ilObjBibliographicAccess::_checkGoto (   $a_target)

check whether goto script will succeed

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

References $lng, ilObject\_lookupObjId(), ilObject\_lookupTitle(), and ilUtil\sendFailure().

44  {
45  global $ilAccess, $lng;
46  $t_arr = explode("_", $a_target);
47 
48  if ($t_arr[0] != "bibl" || ((int) $t_arr[1]) <= 0)
49  {
50  return false;
51  }
52 
53  if ($ilAccess->checkAccess("visible", "", $t_arr[1]))
54  {
55  return true;
56  }
57 
58  $object_title = ilObject::_lookupTitle(ilObject::_lookupObjId($t_arr[1]));
59  ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"), $object_title), true);
60  return false;
61  }
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ _getCommands()

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

Referenced by ilObjBibliographicListGUI\init().

29  {
30  $commands = array
31  (
32  array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true),
33  array("permission" => "write", "cmd" => "view", "lang_var" => "edit_content"),
34  array("permission" => "write", "cmd" => "edit", "lang_var" => "settings")
35  );
36 
37  return $commands;
38  }
+ 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 129 of file class.ilObjBibliographicAccess.php.

Referenced by ilObjBibliographicListGUI\getProperties().

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

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