fix: [ACL] fix wildcard controller checks failing
parent
7fa0537cfd
commit
22be309dc2
|
@ -267,9 +267,19 @@ class ACLComponent extends Component
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//$this->__checkLoggedActions($user, $controller, $action);
|
//$this->__checkLoggedActions($user, $controller, $action);
|
||||||
|
if (isset($this->aclList['*'][$action])) {
|
||||||
|
if ($this->evaluateAccessLeaf('*', $action)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (!isset($this->aclList[$controller])) {
|
if (!isset($this->aclList[$controller])) {
|
||||||
return $this->__error(404, __('Invalid controller.'), $soft);
|
return $this->__error(404, __('Invalid controller.'), $soft);
|
||||||
}
|
}
|
||||||
|
return $this->evaluateAccessLeaf($controller, $action);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function evaluateAccessLeaf(string $controller, string $action): bool
|
||||||
|
{
|
||||||
if (isset($this->aclList[$controller][$action]) && !empty($this->aclList[$controller][$action])) {
|
if (isset($this->aclList[$controller][$action]) && !empty($this->aclList[$controller][$action])) {
|
||||||
if (in_array('*', $this->aclList[$controller][$action])) {
|
if (in_array('*', $this->aclList[$controller][$action])) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue