I want to control permission using ACL for each controller (or Modlues).
I tried to use isAllow() in __constructer, and if denied, I would redirect to an error page from __constructer using $this->redirect()->toURL(). But I couldn’t redirect with error as follow.
Service with name "XXXXX\Controller\HomeController" could not be created. Reason: Redirect plugin requires event compose a response
Is there any recommended way to implement it?