chg: [appcontroller] minor changes
- getRoleAccess now returns array format - moved setting of view variables behind a rest check, to avoid additional unused actions for API queries - current user's role access matrix passed to view via "roleAccess"pull/79/head
parent
fbb1a52724
commit
e408f29a05
|
@ -116,6 +116,7 @@ class AppController extends Controller
|
|||
if (!$this->ParamHandler->isRest()) {
|
||||
$this->set('menu', $this->ACL->getMenu());
|
||||
$this->set('loggedUser', $this->ACL->getUser());
|
||||
$this->set('roleAccess', $this->ACL->getRoleAccess(false, false));
|
||||
}
|
||||
} else if ($this->ParamHandler->isRest()) {
|
||||
throw new MethodNotAllowedException(__('Invalid user credentials.'));
|
||||
|
@ -131,6 +132,7 @@ class AppController extends Controller
|
|||
}
|
||||
|
||||
$this->ACL->checkAccess();
|
||||
if (!$this->ParamHandler->isRest()) {
|
||||
$this->set('breadcrumb', $this->Navigation->getBreadcrumb());
|
||||
$this->set('ajax', $this->request->is('ajax'));
|
||||
$this->request->getParam('prefix');
|
||||
|
@ -145,6 +147,7 @@ class AppController extends Controller
|
|||
$this->set('metaGroup', !empty($this->isAdmin) ? 'Administration' : 'Cerebrate');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function authApiUser(): void
|
||||
{
|
||||
|
@ -191,6 +194,6 @@ class AppController extends Controller
|
|||
|
||||
public function getRoleAccess()
|
||||
{
|
||||
return $this->RestResponse->viewData($this->ACL->getRoleAccess());
|
||||
return $this->RestResponse->viewData($this->ACL->getRoleAccess(false, false));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue