From c0ad1350cdf7af689195816ef9d8c1fd329b0df8 Mon Sep 17 00:00:00 2001 From: Richard Klees Date: Tue, 10 Sep 2024 16:59:13 +0200 Subject: [PATCH] FileServices: correct service locator check The check indicates that this should indeed be able to work when RBAC does not exist in the service locator, but it actually checks an insufficient condition, as `RBACServices` (behind `rbac()`) reaches into the service locator _again_ at the index `rbacsystem`. The existence of `RBACServices` does not imply the existence of `rbacsystem`, though. We could get rid of the first check by checking and using what is actually required here (`$DIC["rbacsystem"]`). --- Services/FileServices/classes/class.ilFileServicesSettings.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Services/FileServices/classes/class.ilFileServicesSettings.php b/Services/FileServices/classes/class.ilFileServicesSettings.php index 9090e4511d7f..cd3fe7f4b505 100644 --- a/Services/FileServices/classes/class.ilFileServicesSettings.php +++ b/Services/FileServices/classes/class.ilFileServicesSettings.php @@ -62,6 +62,7 @@ private function determineByPass(): bool { global $DIC; return $DIC->isDependencyAvailable('rbac') + && isset($DIC["rbacsystem"]) && $DIC->rbac()->system()->checkAccess( 'upload_blacklisted_files', $this->file_admin_ref_id