public function behaviors() { return array_merge(parent::behaviors(), ['verbs' => ['class' => 'yii\\filters\\VerbFilter', 'actions' => ['delete' => ['post']]], 'access' => ['class' => 'yii\\filters\\AccessControl', 'only' => ['index', 'create', 'delete', 'act_on_behalf'], 'rules' => [['allow' => true, 'verbs' => ['GET'], 'actions' => ['index'], 'roles' => ['user_view']], ['allow' => true, 'verbs' => ['POST'], 'actions' => ['act-on-behalf'], 'roles' => ['user_act_on_behalf']], ['allow' => true, 'actions' => ['create', 'delete'], 'roles' => ['user_manage']]]]]); }
public function behaviors() { return array_merge(parent::behaviors(), ['verbs' => ['class' => 'yii\\filters\\VerbFilter', 'actions' => ['delete' => ['post']]], 'access' => ['class' => 'yii\\filters\\AccessControl', 'rules' => [['allow' => true, 'verbs' => ['GET'], 'actions' => ['index', 'update'], 'roles' => ['state_view']], ['allow' => true, 'verbs' => ['POST'], 'roles' => ['state_manage']]]]]); }
/** * @inheritdoc */ public function behaviors() { return array_merge(parent::behaviors(), ['access' => ['class' => 'yii\\filters\\AccessControl', 'rules' => [['allow' => true, 'actions' => ['export'], 'matchCallback' => function ($rule, $action) { return true; }]]]]); }