Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/Auth/AclTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function _check(array $userRoles, array $params) {
}

$iniKey = $this->_constructIniKey($params);
if (empty($this->_acl[$iniKey])) {
if ($iniKey === null || empty($this->_acl[$iniKey])) {
return false;
}

Expand Down Expand Up @@ -420,10 +420,13 @@ protected function _deconstructIniKey($key) {
* Constructs an ACL INI section key from a given Request.
*
* @param array $params The request params
* @return string Hash with named keys for controller, plugin and prefix
* @return string|null Hash with named keys for controller, plugin and prefix
*/
protected function _constructIniKey($params) {
$res = $params['controller'];
protected function _constructIniKey($params): ?string {
$res = $params['controller'] ?? null;
if ($res === null) {
return null;
}
if (!empty($params['prefix'])) {
$res = $params['prefix'] . "/$res";
}
Expand Down