/** * @param $id */ public function actionDelete($id) { if ($this->isCurrentUser($id)) { Yii::app()->user->setFlash('danger', 'You can\'t delete yourself.'); $this->redirect('/'); } $this->accessGranted(User::ROLE_ADMIN); parent::actionDelete($id); }