Example #1
0
 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']]];
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function behaviors()
 {
     return [['class' => AjaxFilter::className(), 'actions' => ['program', 'discipline', 'result']]];
 }
Example #3
0
 public function behaviors()
 {
     return [['class' => AjaxFilter::className(), 'actions' => ['load-file', 'states', 'update-state', 'create-state']]];
 }
Example #4
0
 public function behaviors()
 {
     return [['class' => AjaxFilter::className(), 'actions' => ['view', 'create', 'update', 'delete']]];
 }
Example #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']]];
 }