45 "permission" =>
"read",
50 array(
"permission" =>
"write",
"cmd" =>
"view",
"lang_var" =>
"edit_content"),
51 array(
"permission" =>
"write",
"cmd" =>
"edit",
"lang_var" =>
"settings"),
59 $ilAccess = $DIC[
'ilAccess'];
60 $t_arr = explode(
'_', $target);
61 if ($t_arr[0] !=
'bibl' || ((
int) $t_arr[1]) <= 0) {
64 return (
bool) $ilAccess->checkAccess(
'read',
'', $t_arr[1]);
72 public function _checkAccess(
string $cmd,
string $permission,
int $ref_id,
int $obj_id, ?
int $user_id = null): bool
77 $rbacsystem = $DIC[
'rbacsystem'];
78 $ilAccess = $DIC[
'ilAccess'];
79 if (is_null($user_id)) {
84 $entry_id = $DIC->http()->wrapper()->query()->retrieve(
86 $DIC->refinery()->kindlyTo()->int()
88 if (!self::checkEntryIdMatch($obj_id, $entry_id)) {
95 if (!self::_lookupOnline($obj_id)
96 && !$rbacsystem->checkAccessOfUser($user_id,
'write', $ref_id)
105 if (!self::_lookupOnline($obj_id)) {
112 switch ($permission) {
115 if (!self::_lookupOnline($obj_id)
116 && (!$rbacsystem->checkAccessOfUser($user_id,
'write', $ref_id))
129 private static function checkEntryIdMatch(
int $obj_id,
int $entry_id):
bool 134 $ilBiblEntry = ilBiblEntry::find($entry_id);
135 if (is_null($ilBiblEntry)) {
139 return ($ilBiblEntry->getDataId() === $obj_id);
149 $ilDB = $DIC[
'ilDB'];
150 $q =
"SELECT is_online FROM il_bibl_data WHERE id = " .
$ilDB->quote($a_id,
"integer");
151 $bibl_set =
$ilDB->query($q);
152 $bibl_rec =
$ilDB->fetchAssoc($bibl_set);
154 return (
bool) $bibl_rec[
"is_online"] ??
false;
const IL_NO_OBJECT_ACCESS
static _lookupOnline(int $a_id)
Check wether bibliographic is online or not.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _checkGoto(string $target)
static _getCommands()
get commands
_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::checkAcc...