Преглед изворни кода

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

master
keun пре 8 година
родитељ
комит
7cd0de7aec
8 измењених фајлова са 683 додато и 696 уклоњено
  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
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 11
- 10
backend/controllers/PointVenteController.php Прегледај датотеку

@@ -25,17 +25,18 @@ class PointVenteController extends Controller
'delete' => ['post'],
],
],
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
'allow' => true,
'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 Прегледај датотеку

@@ -40,7 +40,8 @@ class ProduitController extends Controller
'allow' => true,
'roles' => ['@'],
'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 Прегледај датотеку

@@ -30,8 +30,9 @@ class SiteController extends Controller
'actions' => ['logout', 'index'],
'allow' => true,
'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 Прегледај датотеку

@@ -23,7 +23,8 @@ class StatsController extends Controller {
'allow' => true,
'roles' => ['@'],
'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 Прегледај датотеку

@@ -31,9 +31,10 @@ class UserController extends Controller
[
'allow' => true,
'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 Прегледај датотеку

@@ -40,7 +40,8 @@ class VracController extends Controller
'allow' => true,
'roles' => ['@'],
'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 Прегледај датотеку

@@ -27,6 +27,7 @@ class User extends ActiveRecord implements IdentityInterface
{
const STATUS_DELETED = 0;
const STATUS_ACTIVE = 10;
const STATUS_BOULANGER = 11;
const STATUS_ADMIN = 13;

/**

Loading…
Откажи
Сачувај