ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilObjBibliographicAccess Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
- Public Member Functions inherited from ilObjectAccess
 _checkAccess (string $cmd, string $permission, int $ref_id, int $obj_id, ?int $user_id=null)
 Checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess) More...
 
 canBeDelivered (ilWACPath $ilWACPath)
 
 canBeDelivered (ilWACPath $ilWACPath)
 

Static Public Member Functions

static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _lookupOnline (int $a_id)
 Check wether bibliographic is online or not. More...
 
- Static Public Member Functions inherited from ilObjectAccess
static _getCommands ()
 get commands More...
 
static _checkGoto (string $target)
 check whether goto script will succeed More...
 
static _isOffline (int $obj_id)
 Type-specific implementation of general status, has to be overwritten if object type does not support centralized offline handling. More...
 
static _preloadData (array $obj_ids, array $ref_ids)
 Preload data. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilObjBibliographicAccess

Author
Oskar Truffer ot@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Gabriel Comte gc@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

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

Member Function Documentation

◆ _checkAccess()

ilObjBibliographicAccess::_checkAccess ( string  $cmd,
string  $permission,
int  $ref_id,
int  $obj_id,
?int  $user_id = null 
)

checks whether a user may invoke a command or not (this method is called by ilAccessHandler::checkAccess)

Reimplemented from ilObjectAccess.

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

75 : bool
76 {
77 global $DIC;
78 $ilUser = $DIC['ilUser'];
79 $lng = $DIC['lng'];
80 $rbacsystem = $DIC['rbacsystem'];
81 $ilAccess = $DIC['ilAccess'];
82 if (is_null($user_id)) {
83 $user_id = $ilUser->getId();
84 }
85
86 if ($DIC->http()->wrapper()->query()->has(ilObjBibliographicGUI::P_ENTRY_ID)) {
87 $entry_id = $DIC->http()->wrapper()->query()->retrieve(
89 $DIC->refinery()->kindlyTo()->int()
90 );
91 if (!$this->checkEntryIdMatch($obj_id, $entry_id)) {
92 return false;
93 }
94 }
95
96 switch ($cmd) {
97 case "view":
98 if (!self::_lookupOnline($obj_id)
99 && !$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id)
100 ) {
101 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
102
103 return false;
104 }
105 break;
106 // for permission query feature
107 case "infoScreen":
108 if (!self::_lookupOnline($obj_id)) {
109 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
110 } else {
111 $ilAccess->addInfoItem(ilAccessInfo::IL_STATUS_MESSAGE, $lng->txt("online"));
112 }
113 break;
114 }
115 switch ($permission) {
116 case "read":
117 case "visible":
118 if (!self::_lookupOnline($obj_id)
119 && (!$rbacsystem->checkAccessOfUser($user_id, 'write', $ref_id))
120 ) {
121 $ilAccess->addInfoItem(ilAccessInfo::IL_NO_OBJECT_ACCESS, $lng->txt("offline"));
122
123 return false;
124 }
125 break;
126 }
127
128 return true;
129 }
$ref_id
Definition: ltiauth.php:66
global $lng
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26

References $DIC, $lng, $ref_id, $user_id, ilAccessInfo\IL_NO_OBJECT_ACCESS, ilAccessInfo\IL_STATUS_MESSAGE, and ilObjBibliographicGUI\P_ENTRY_ID.

◆ _checkGoto()

static ilObjBibliographicAccess::_checkGoto ( string  $target)
static

check whether goto script will succeed

Reimplemented from ilObjectAccess.

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

58 : bool
59 {
60 global $DIC;
61 $ilAccess = $DIC['ilAccess'];
62 $t_arr = explode('_', $target);
63 if ($t_arr[0] !== 'bibl' || ((int) $t_arr[1]) <= 0) {
64 return false;
65 }
66 return (bool) $ilAccess->checkAccess('read', '', $t_arr[1]);
67 }

References $DIC.

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

Returns
array<int, array<string, string>>|array<int, array<string, string|bool>>

Reimplemented from ilObjectAccess.

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

42 : array
43 {
44 return [
45 [
46 "permission" => "read",
47 "cmd" => "render",
48 "lang_var" => "show",
49 "default" => true,
50 ],
51 ["permission" => "write", "cmd" => "view", "lang_var" => "edit_content"],
52 ["permission" => "write", "cmd" => "settings", "lang_var" => "settings"],
53 ];
54 }

Referenced by ilObjBibliographicListGUI\init().

+ Here is the caller graph for this function:

◆ _lookupOnline()

static ilObjBibliographicAccess::_lookupOnline ( int  $a_id)
static

Check wether bibliographic is online or not.

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

149 : bool
150 {
151 $bibl_obj = new ilObjBibliographic($a_id);
152 return $bibl_obj->getObjectProperties()->getPropertyIsOnline()->getIsOnline();
153 }
Class ilObjBibliographic.

Referenced by ilObjBibliographicListGUI\getProperties().

+ Here is the caller graph for this function:

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