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