ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
UploadRestrictionBypassLegacyProxy.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
33{
34 private const string PERMISSION = 'upload_blacklisted_files';
35
36 private ?bool $granted = null;
37
38 public function isGrantedToCurrentUser(): bool
39 {
40 if ($this->granted !== null) {
41 return $this->granted;
42 }
43
44 global $DIC;
45 return $this->granted = ($DIC->isDependencyAvailable('rbac')
46 && isset($DIC['rbacsystem'])
47 && $DIC->rbac()->system()->checkAccess(
48 self::PERMISSION,
50 ));
51 }
52
53 private function determineFileAdminRefId(): int
54 {
55 global $DIC;
56 try {
57 $r = $DIC->database()->query(
58 "SELECT ref_id FROM object_reference JOIN object_data ON object_reference.obj_id = object_data.obj_id WHERE object_data.type = 'facs';"
59 );
60 $r = $DIC->database()->fetchObject($r);
61 return (int) ($r->ref_id ?? 0);
62 } catch (\Throwable) {
63 return 0;
64 }
65 }
66}
Resolves the bypass permission through the legacy container, since the public RBAC surface of AccessC...
Tells whether the current user holds the permission of the file services administration to upload fil...
global $DIC
Definition: shib_login.php:26