public function preDispatch(Request $req, Response $res) { parent::preDispatch($req, $res); if (!in_array($req->user->role, ['administrator', 'developer'])) { return $this->forward('forbidden', 'index'); } }
public function edit(Request $req, Response $res) { $req->id = $req->user->id; return parent::edit($req, $res); }