示例#1
0
 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]);
 }
示例#2
0
 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]);
 }