ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjBibliographicAccess Class Reference

Class ilObjBibliographicAccess. More...

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

Public Member Functions

 _getCommands ()
 get commands More...
 
 _checkGoto ($a_target)
 
 _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...
 
 _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

Reimplemented from ilObjectAccess.

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

71 {
72 global $ilUser, $lng, $rbacsystem, $ilAccess;
73 if ($a_user_id == "") {
74 $a_user_id = $ilUser->getId();
75 }
76 switch ($a_cmd) {
77 case "view":
78 if (! self::_lookupOnline($a_obj_id)
79 && ! $rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id)
80 ) {
81 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
82
83 return false;
84 }
85 break;
86 // for permission query feature
87 case "infoScreen":
88 if (! self::_lookupOnline($a_obj_id)) {
89 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
90 } else {
91 $ilAccess->addInfoItem(IL_STATUS_MESSAGE, $lng->txt("online"));
92 }
93 break;
94 }
95 switch ($a_permission) {
96 case "read":
97 case "visible":
98 if (! self::_lookupOnline($a_obj_id)
99 && (! $rbacsystem->checkAccessOfUser($a_user_id, 'write', $a_ref_id))
100 ) {
101 $ilAccess->addInfoItem(IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
102
103 return false;
104 }
105 break;
106 }
107
108 return true;
109 }
const IL_NO_OBJECT_ACCESS
global $lng
Definition: privfeed.php:40
global $ilUser
Definition: imgupload.php:15

References $ilUser, $lng, and IL_NO_OBJECT_ACCESS.

◆ _checkGoto()

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

Reimplemented from ilObjectAccess.

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

45 {
46 global $ilAccess, $lng;
47 $t_arr = explode('_', $a_target);
48 if ($t_arr[0] != 'bibl' || ((int)$t_arr[1]) <= 0) {
49 return false;
50 }
51 if ($ilAccess->checkAccess('read', '', $t_arr[1])) {
52 return true;
53 }
54
55 return false;
56 }

References $lng.

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

Reimplemented from ilObjectAccess.

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

28 {
29 $commands = array
30 (
31 array( "permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true ),
32 array( "permission" => "write", "cmd" => "view", "lang_var" => "edit_content" ),
33 array( "permission" => "write", "cmd" => "edit", "lang_var" => "settings" )
34 );
35
36 return $commands;
37 }

Referenced by ilObjBibliographicListGUI\init().

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

117 {
118 global $ilDB;
119 $q = "SELECT is_online FROM il_bibl_data WHERE id = " .
120 $ilDB->quote($a_id, "integer");
121 $bibl_set = $ilDB->query($q);
122 $bibl_rec = $ilDB->fetchAssoc($bibl_set);
123
124 return $bibl_rec["is_online"];
125 }
global $ilDB

References $ilDB.

Referenced by ilObjBibliographicListGUI\getProperties().

+ Here is the caller graph for this function:

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