public function behaviors() { return ['access' => ['class' => \yii\filters\AccessControl::className(), 'except' => ['login', 'logout', 'autologin'], 'ruleConfig' => ['class' => \backend\components\AccessRule::className()], 'rules' => [['allow' => true, 'actions' => ['list', 'cashlist', 'inlist', 'outlist', 'reject', 'add', 'approve', 'validateadd'], 'roles' => [\backend\models\User::SUPPER_ADMIN]], ['allow' => true, 'actions' => ['list', 'cashlist', 'inlist', 'outlist'], 'roles' => [\backend\models\User::STACK_TWO_ADMIN]]]]]; }
public function behaviors() { return ['access' => ['class' => AccessControl::className(), 'except' => ['login', 'logout', 'autologin'], 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'actions' => ['index', 'approvedindex', 'unapprovedindex', 'approve', 'resetpassword', 'reject', 'validate', 'create', 'update', 'view', 'delete'], 'roles' => [User::SUPPER_ADMIN]], ['allow' => true, 'actions' => ['index', 'create', 'out', 'validate'], 'roles' => [User::STACK_ADMIN]]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]]; }
public function behaviors() { return ['access' => ['class' => AccessControl::className(), 'except' => ['login', 'logout', 'autologin'], 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'actions' => ['password', 'log', 'index', 'backup', 'backupindex'], 'roles' => [User::SUPPER_ADMIN]], ['allow' => true, 'actions' => ['password'], 'roles' => [User::STACK_ADMIN]], ['allow' => true, 'actions' => ['password'], 'roles' => [User::STACK_TWO_ADMIN]]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['POST']]]]; }
public function behaviors() { return ['access' => ['class' => AccessControl::className(), 'except' => ['login', 'logout', 'autologin'], 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'actions' => ['index', 'history', 'view', 'create', 'update', 'lock', 'clear', 'settings', 'delete', 'add', 'validateadd'], 'roles' => [User::SUPPER_ADMIN]]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['delete' => ['post']]]]; }
/** * 整个系统后台的权限控制入口 * @inheritdoc */ public function behaviors() { //*****首先你应该匹配了才知道有没有权限(默认是匹配状态)****** return ['access' => ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'actions' => $this->getActions()], ['allow' => false, 'ips' => $this->getIps()], ['allow' => false, 'controllers' => $this->getControllers()], ['allow' => false, 'verbs' => $this->getVerbs()], ['allow' => true, 'roles' => $this->getRoles()]]]]; }
/** * @inheritdoc */ public function behaviors() { return ['access' => ['class' => \yii\filters\AccessControl::className(), 'except' => ['login', 'logout', 'autologin'], 'ruleConfig' => ['class' => \backend\components\AccessRule::className()], 'rules' => [['actions' => ['login', 'error', 'captcha'], 'allow' => true, 'roles' => ['?']], ['actions' => ['logout', 'index'], 'allow' => true, 'roles' => ['@']]]], 'verbs' => ['class' => VerbFilter::className(), 'actions' => ['logout' => ['post']]]]; }
public function behaviors() { return ['access' => ['class' => AccessControl::className(), 'except' => ['login', 'logout', 'autologin'], 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['allow' => true, 'actions' => ['index', 'view', 'create', 'update', 'delete'], 'roles' => [User::SUPPER_ADMIN]]]]]; }
/** * @inheritdoc */ public function behaviors() { $behaviors = parent::behaviors(); $behaviors['access'] = ['class' => AccessControl::className(), 'ruleConfig' => ['class' => AccessRule::className()], 'rules' => [['roles' => [User::ROLE_ADMIN], 'allow' => true], ['actions' => ['error'], 'allow' => true]]]; return $behaviors; }