コード例 #1
0
ファイル: GridController.php プロジェクト: vastander/yii2-eer
 public function behaviors()
 {
     return ['access' => ['class' => AccessControl::className(), 'rules' => [['allow' => true, 'actions' => ['index', 'create'], 'roles' => ['updateFaculty'], 'matchCallback' => function ($rule, $action) {
         return Yii::$app->user->can('updateFaculty', ['id_faculty' => $this->getIdFaculty(Yii::$app->request->get('idParent'), true)]);
     }], ['allow' => true, 'actions' => ['update', 'delete'], 'roles' => ['updateFaculty'], 'matchCallback' => function ($rule, $action) {
         return Yii::$app->user->can('updateFaculty', ['id_faculty' => $this->getIdFaculty(Yii::$app->request->get('id'))]);
     }]], 'denyCallback' => function ($rule, $action) {
         $this->redirect(['/site/login']);
     }], 'ajax' => ['class' => AjaxFilter::className(), 'actions' => ['create', 'update', 'delete']]];
 }
コード例 #2
0
ファイル: MainController.php プロジェクト: vastander/yii2-eer
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => AjaxFilter::className(), 'actions' => ['program', 'discipline', 'result']]];
 }
コード例 #3
0
 public function behaviors()
 {
     return [['class' => AjaxFilter::className(), 'actions' => ['load-file', 'states', 'update-state', 'create-state']]];
 }
コード例 #4
0
 public function behaviors()
 {
     return [['class' => AjaxFilter::className(), 'actions' => ['view', 'create', 'update', 'delete']]];
 }
コード例 #5
0
 public function behaviors()
 {
     return ['access' => ['class' => AccessControl::className(), 'rules' => [['allow' => true, 'actions' => ['index', 'update', 'delete'], 'roles' => ['updateFaculty'], 'matchCallback' => [$this, 'CheckFaculty']]], 'denyCallback' => function ($rule, $action) {
         $this->redirect(['/site/login']);
     }], 'ajax' => ['class' => AjaxFilter::className(), 'actions' => ['update', 'delete']]];
 }