public function behaviors() { // $this->layout = "/main.twig"; return ['access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'only' => ['logout'], 'rules' => [['actions' => ['create'], 'allow' => true, 'roles' => ['admin']], ['actions' => ['logout'], 'allow' => true, 'roles' => ['@']], ['actions' => ['view', 'search'], 'allow' => true, 'roles' => ['?', '*', 'admin']]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['logout' => ['post']]]]; }
/** @inheritdoc */ public function behaviors() { return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post'], 'confirm' => ['post'], 'ban' => ['post']]], 'access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'roles' => ['users:admin-access']]]]]; }
public function behaviors() { return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['edit-battle' => ['head', 'get', 'post'], '*' => ['head', 'get']]], 'access' => ['class' => AccessControl::className(), 'only' => ['edit-battle'], 'rules' => [['actions' => ['edit-battle'], 'roles' => ['@'], 'allow' => true]], 'ruleConfig' => ['class' => AccessRule::className(), 'matchCallback' => function ($rule, $action) { return $action->isEditable; }]]]; }
/** * @inheritdoc */ public function behaviors() { return ['access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['actions' => ['index', 'create', 'update', 'delete', 'bulk-action', 'ajax-search'], 'allow' => true, 'roles' => ['subscriber']]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post'], 'bulk-action' => ['post'], 'ajax-search' => ['post']]]]; }
public function behaviors() { return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]], 'access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['actions' => ['view', 'search', 'index', 'create', 'update', 'delete'], 'allow' => true, 'roles' => ['admin']]]]]; }
/** * Specifies the access control rules. * This method is used by the 'accessControl' filter. * @return array access control rules */ public function behaviors() { return ['verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post'], 'AjaxUpdateStatus' => ['post'], 'AjaxUpdateSetNew' => ['post'], 'AjaxUpdateSetOld' => ['post'], 'AjaxDelete' => ['post']]], 'access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => \Yii::$app->getModule('comments')->isSuperuser() ? true : false, 'roles' => ['@']]]]]; }
public function behaviors() { // $this->layout = "/admin.php"; return ['access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'roles' => ['manager']]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['logout' => ['post']]]]; }