Jaxel
Well-known member
I have a public controller... each function of it, has their own little permissions. But there is also a global permission which must be true in order to do any of the functions. Do I need to check this global permission in every single function? Or can I do it in a preDispatch? I am trying using the following code below, but it doesn't seem to fire. If I move this permission check into each function, it works, but I would rather keep the redundancy down.
PHP:
public function _preDispatch($action)
{
parent::_preDispatch($action);
$this->perms = $this->getModelFromCache('EWRmedio_Model_Perms')->getPerm();
if (!$this->perms['view']) { return $this->responseNoPermission(); } // ???
}