ILIAS  release_8 Revision v8.24
class.DashboardAccess.php
Go to the documentation of this file.
1<?php
2
20
22{
23 protected \ilRbacSystem $rbac_system;
24 protected \ilDBInterface $db;
25 protected static int $setting_ref_id = 0;
26
27 public function __construct()
28 {
29 global $DIC;
30
31 $this->db = $DIC->database();
32 $this->rbac_system = $DIC->rbac()->system();
33 }
34
38 protected function getSettingsRefId(): int
39 {
40 if (self::$setting_ref_id == 0) {
41 $set = $this->db->queryF(
42 'SELECT object_reference.ref_id FROM object_reference, tree, object_data
43 WHERE tree.parent = %s
44 AND object_data.type = %s
45 AND object_reference.ref_id = tree.child
46 AND object_reference.obj_id = object_data.obj_id',
47 array('integer', 'text'),
48 array(SYSTEM_FOLDER_ID, 'dshs')
49 );
50 $rec = $this->db->fetchAssoc($set);
51 self::$setting_ref_id = (int) $rec["ref_id"];
52 }
54 }
55
56 public function canChangePresentation(int $user_id): bool
57 {
58 return $this->rbac_system->checkAccessOfUser($user_id, "change_presentation", $this->getSettingsRefId());
59 }
60}
getSettingsRefId()
Get dashboard settings ref id.
const SYSTEM_FOLDER_ID
Definition: constants.php:35
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...