diff --git a/src/Controller/AppController.php b/src/Controller/AppController.php index e095561..0b6aaa3 100644 --- a/src/Controller/AppController.php +++ b/src/Controller/AppController.php @@ -101,12 +101,15 @@ class AppController extends Controller public function beforeFilter(EventInterface $event) { + $this->loadModel('Settings'); + $this->Settings->loadSettings(); $this->loadModel('Users'); $this->Users->checkForNewInstance(); if ($this->ParamHandler->isRest()) { $this->authApiUser(); $this->Security->setConfig('unlockedActions', [$this->request->getParam('action')]); } + $this->ACL->setPublicInterfaces(); if (!empty($this->request->getAttribute('identity'))) { $user = $this->Users->get($this->request->getAttribute('identity')->getIdentifier(), [ diff --git a/src/Model/Table/SettingsTable.php b/src/Model/Table/SettingsTable.php index 2eb941c..ad35c05 100644 --- a/src/Model/Table/SettingsTable.php +++ b/src/Model/Table/SettingsTable.php @@ -126,7 +126,7 @@ class SettingsTable extends AppTable return $settings; } - private function loadSettings(): void + public function loadSettings(): void { $settings = file_get_contents(CONFIG . 'config.json'); $settings = json_decode($settings, true);