Browse Source

Adapter les droits du backend pour autoriser les boulangers à y accéder

prodstable
keun 8 years ago
parent
commit
7cd0de7aec
8 changed files with 683 additions and 696 deletions
  1. +658
    -678
      backend/controllers/CommandeController.php
  2. +11
    -10
      backend/controllers/PointVenteController.php
  3. +2
    -1
      backend/controllers/ProduitController.php
  4. +3
    -2
      backend/controllers/SiteController.php
  5. +2
    -1
      backend/controllers/StatsController.php
  6. +4
    -3
      backend/controllers/UserController.php
  7. +2
    -1
      backend/controllers/VracController.php
  8. +1
    -0
      common/models/User.php

+ 658
- 678
backend/controllers/CommandeController.php
File diff suppressed because it is too large
View File


+ 11
- 10
backend/controllers/PointVenteController.php View File

'delete' => ['post'], 'delete' => ['post'],
], ],
], ],
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ;
}
],
],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
}
],
],
], ],
]; ];
} }

+ 2
- 1
backend/controllers/ProduitController.php View File

'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) { 'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ;
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
} }
] ]
], ],

+ 3
- 2
backend/controllers/SiteController.php View File

'actions' => ['logout', 'index'], 'actions' => ['logout', 'index'],
'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == User::STATUS_ADMIN ;
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
} }
], ],
], ],

+ 2
- 1
backend/controllers/StatsController.php View File

'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) { 'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ;
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
} }
] ]
], ],

+ 4
- 3
backend/controllers/UserController.php View File

[ [
'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
/*'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ;
}*/
'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
}
] ]
], ],
], ],

+ 2
- 1
backend/controllers/VracController.php View File

'allow' => true, 'allow' => true,
'roles' => ['@'], 'roles' => ['@'],
'matchCallback' => function ($rule, $action) { 'matchCallback' => function ($rule, $action) {
return Yii::$app->user->identity->status == USER::STATUS_ADMIN ;
return Yii::$app->user->identity->status == USER::STATUS_ADMIN
|| Yii::$app->user->identity->status == USER::STATUS_BOULANGER;
} }
] ]
], ],

+ 1
- 0
common/models/User.php View File

{ {
const STATUS_DELETED = 0; const STATUS_DELETED = 0;
const STATUS_ACTIVE = 10; const STATUS_ACTIVE = 10;
const STATUS_BOULANGER = 11;
const STATUS_ADMIN = 13; const STATUS_ADMIN = 13;


/** /**

Loading…
Cancel
Save