コード例 #1
0
 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]]]]];
 }
コード例 #2
0
 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']]]];
 }
コード例 #3
0
 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']]]];
 }
コード例 #4
0
 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']]]];
 }
コード例 #5
0
ファイル: Controller.php プロジェクト: xidiao/gxfenxi
 /**
  * 整个系统后台的权限控制入口
  * @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()]]]];
 }
コード例 #6
0
 /**
  * @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']]]];
 }
コード例 #7
0
 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]]]]];
 }
コード例 #8
0
 /**
  * @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;
 }