/** * Permission editting * @param string $name Permission name * @return void */ public function actionUpdate($name) { $item = Yii::$app->authManager->getPermission($name); if ($item === null) { throw new BadRequestHttpException(Yii::t('user', 'Premission was not found.')); } $model = new PermissionForm(['item' => $item]); if ($model->load(Yii::$app->request->post()) && $model->update()) { Yii::$app->session->setFlash('success', Yii::t('Changes saved successfully.')); return $this->redirect(['index']); } return $this->render('update', ['model' => $model]); }
/** * Role updating * @return boolean */ public function update() { if (parent::update() === false) { return false; } return $this->updateRelative(); }