6 include_once(
"./Services/Object/classes/class.ilObjectAccess.php");
47 $this->
user = $DIC->user();
48 $this->lng = $DIC->language();
49 $this->rbacsystem = $DIC->rbac()->system();
50 $this->access = $DIC->access();
68 public function _checkAccess($a_cmd, $a_permission, $a_ref_id, $a_obj_id, $a_user_id =
"")
75 if ($a_user_id ==
"") {
83 && !
$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)) {
90 if (!
$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id)) {
124 switch ($a_permission) {
128 (!
$rbacsystem->checkAccessOfUser($a_user_id,
'write', $a_ref_id))) {
152 $ilDB = $DIC->database();
154 if (isset(self::$online[$a_id])) {
155 return self::$online[$a_id];
158 $q =
"SELECT is_online FROM content_object WHERE id = " .
$ilDB->quote($a_id,
"integer");
176 $ilDB = $DIC->database();
179 if ($a_user_id ==
"") {
183 if (isset(self::$lo_access[$a_ref_id])) {
184 $acc_rec[
"obj_id"] = self::$lo_access[$a_ref_id];
186 $q =
"SELECT * FROM lo_access WHERE " .
187 "usr_id = " .
$ilDB->quote($a_user_id,
"integer") .
" AND " .
188 "lm_id = " .
$ilDB->quote($a_ref_id,
"integer");
190 $acc_set =
$ilDB->query($q);
191 $acc_rec =
$ilDB->fetchAssoc($acc_set);
194 if ($acc_rec[
"obj_id"] > 0) {
196 $mtree =
new ilTree($lm_id);
197 $mtree->setTableNames(
'lm_tree',
'lm_data');
198 $mtree->setTreeTablePK(
"lm_id");
199 if ($mtree->isInTree($acc_rec[
"obj_id"])) {
200 return $acc_rec[
"obj_id"];
214 $ilAccess = $DIC->access();
216 $t_arr = explode(
"_", $a_target);
218 if (($t_arr[0] !=
"lm" && $t_arr[0] !=
"st" 219 && $t_arr[0] !=
"pg")
220 || ((
int) $t_arr[1]) <= 0) {
224 if ($t_arr[0] ==
"lm") {
225 if ($ilAccess->checkAccess(
"read",
"", $t_arr[1]) ||
226 $ilAccess->checkAccess(
"visible",
"", $t_arr[1])) {
231 $ref_ids =
array($t_arr[2]);
234 include_once(
"./Modules/LearningModule/classes/class.ilLMObject.php");
239 foreach ($ref_ids as $ref_id) {
241 if ($ilAccess->checkAccess(
"read",
"", $ref_id)) {
259 return !self::_lookupOnline($a_obj_id);
271 $ilDB = $DIC->database();
274 $q =
"SELECT id, is_online FROM content_object WHERE " .
275 $ilDB->in(
"id", $a_obj_ids,
false,
"integer");
279 self::$online[$rec[
"id"]] =
ilUtil::yn2tf($rec[
"is_online"]);
282 $q =
"SELECT obj_id, lm_id FROM lo_access WHERE " .
283 "usr_id = " .
$ilDB->quote(
$ilUser->getId(),
"integer") .
" AND " .
284 $ilDB->in(
"lm_id", $a_ref_ids,
false,
"integer");
286 $set =
$ilDB->query($q);
287 foreach ($a_ref_ids as
$r) {
288 self::$lo_access[
$r] = 0;
290 while ($rec =
$ilDB->fetchAssoc($set)) {
291 self::$lo_access[$rec[
"lm_id"]] = $rec[
"obj_id"];
static _preloadData($a_obj_ids, $a_ref_ids)
Preload data.
const IL_NO_OBJECT_ACCESS
static _lookupContObjID($a_id)
get learning module / digibook id for lm object
static _getAllReferences($a_id)
get all reference ids of object
static _checkGoto($a_target)
check whether goto script will succeed
static _lookupObjId($a_id)
Class ilObjContentObjectAccess.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
__construct()
Constructor.
_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::checkAcce...
static _isOffline($a_obj_id)
Type-specific implementation of general status.
static yn2tf($a_yn)
convert "y"/"n" to true/false
static _getLastAccessedPage($a_ref_id, $a_user_id="")
get last accessed page
static _lookupOnline($a_id)
check wether learning module is online