From e693ad7441bdd300c1253a168c6cf0376f284ee1 Mon Sep 17 00:00:00 2001 From: mscherer Date: Mon, 28 Oct 2019 21:12:03 +0100 Subject: [PATCH] Backport fix to avoid reading global config data. --- src/Auth/AclTrait.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Auth/AclTrait.php b/src/Auth/AclTrait.php index a65db5c1..99d5d075 100644 --- a/src/Auth/AclTrait.php +++ b/src/Auth/AclTrait.php @@ -363,7 +363,11 @@ protected function _getAvailableRoles() { return $this->_roles; } - $roles = Configure::read($this->getConfig('rolesTable')); + $rolesTableKey = $this->getConfig('rolesTable'); + if (!$rolesTableKey) { + throw new Exception('Invalid/missing rolesTable config'); + } + $roles = Configure::read($rolesTableKey); if (is_array($roles)) { if ($this->getConfig('superAdminRole')) { $key = $this->getConfig('superAdmin') ?: 'superadmin';