public function actionPermissions($id) { $modelForm = new AssignmentForm(); $modelForm->model = $this->findModel($id); if ($modelForm->load(Yii::$app->request->post()) && $modelForm->save()) { Yii::$app->session->setFlash('success', Yii::t('users', 'SUCCESS_UPDATE_PERMISSIONS')); return $this->redirect(['view', 'id' => $id]); } return $this->render('permissions', ['modelForm' => $modelForm]); }
public function actionChildren($id, $type) { $modelForm = new AssignmentForm(); $modelForm->model = $this->findModel($id, 'vovmog\\users\\models\\AuthItem'); $modelForm->target = $this->findAuthEntity($id, $type); if ($modelForm->load(Yii::$app->request->post()) && $modelForm->save()) { return $this->redirect(Yii::$app->request->url); } return $this->render('children', ['modelForm' => $modelForm]); }