Beispiel #1
0
 public function behaviors(){
     return [
         'access' => [
             'class' => AccessControl::className(),
             // We will override the default rule config with the new AccessRule class
             'ruleConfig' => [
                 'class' => AccessRule::className(),
             ],
             'rules' => $this->rules()
         ],
         'verbs' => [
             'class' => VerbFilter::className(),
             'actions' => $this->verbs
         ],
     ];
 }
 public function behaviors(){
     return [
         'access' => [
             'class' => AccessControl::className(),
             'ruleConfig' => [
                 'class' => AccessRule::className(),
             ],
             'rules' => [
                 [
                     'actions' => ['index'],
                     'allow' => true,
                     'roles' => [
                         DatabaseHelper::DEALER
                     ],
                 ],
             ],
         ],
     ];
 }
 public function behaviors(){
     return [
         'access' => [
             'class' => AccessControl::className(),
             // We will override the default rule config with the new AccessRule class
             'ruleConfig' => [
                 'class' => AccessRule::className(),
             ],
             'rules' => [
                 [
                     'actions' => ['index'],
                     'allow' => true,
                     'roles' => [
                         DatabaseHelper::DEALER,
                         DatabaseHelper::COMPANY_ADMIN
                     ],
                 ],
             ],
         ],
     ];
 }