Commit faf0eca827a9a147be248601a39b11412376d575
1 parent
7b952362
access control
Showing
5 changed files
with
85 additions
and
0 deletions
Show diff stats
controllers/DeliveryController.php
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | use yii\web\Controller; | 8 | use yii\web\Controller; |
| 9 | use yii\web\NotFoundHttpException; | 9 | use yii\web\NotFoundHttpException; |
| 10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
| 11 | + use yii\filters\AccessControl; | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * DeliveryController implements the CRUD actions for Delivery model. | 14 | * DeliveryController implements the CRUD actions for Delivery model. |
| @@ -34,6 +35,22 @@ | @@ -34,6 +35,22 @@ | ||
| 34 | 'delete' => [ 'POST' ], | 35 | 'delete' => [ 'POST' ], |
| 35 | ], | 36 | ], |
| 36 | ], | 37 | ], |
| 38 | + 'access' => [ | ||
| 39 | + 'class' => AccessControl::className(), | ||
| 40 | + 'rules' => [ | ||
| 41 | + [ | ||
| 42 | + 'actions' => [ | ||
| 43 | + 'login', | ||
| 44 | + 'error', | ||
| 45 | + ], | ||
| 46 | + 'allow' => true, | ||
| 47 | + ], | ||
| 48 | + [ | ||
| 49 | + 'allow' => true, | ||
| 50 | + 'roles' => [ '@' ], | ||
| 51 | + ], | ||
| 52 | + ], | ||
| 53 | + ], | ||
| 37 | ]; | 54 | ]; |
| 38 | } | 55 | } |
| 39 | 56 |
controllers/LabelController.php
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | use yii\web\Controller; | 8 | use yii\web\Controller; |
| 9 | use yii\web\NotFoundHttpException; | 9 | use yii\web\NotFoundHttpException; |
| 10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
| 11 | + use yii\filters\AccessControl; | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * LabelController implements the CRUD actions for Label model. | 14 | * LabelController implements the CRUD actions for Label model. |
| @@ -34,6 +35,22 @@ | @@ -34,6 +35,22 @@ | ||
| 34 | 'delete' => [ 'POST' ], | 35 | 'delete' => [ 'POST' ], |
| 35 | ], | 36 | ], |
| 36 | ], | 37 | ], |
| 38 | + 'access' => [ | ||
| 39 | + 'class' => AccessControl::className(), | ||
| 40 | + 'rules' => [ | ||
| 41 | + [ | ||
| 42 | + 'actions' => [ | ||
| 43 | + 'login', | ||
| 44 | + 'error', | ||
| 45 | + ], | ||
| 46 | + 'allow' => true, | ||
| 47 | + ], | ||
| 48 | + [ | ||
| 49 | + 'allow' => true, | ||
| 50 | + 'roles' => [ '@' ], | ||
| 51 | + ], | ||
| 52 | + ], | ||
| 53 | + ], | ||
| 37 | ]; | 54 | ]; |
| 38 | } | 55 | } |
| 39 | 56 |
controllers/OrderController.php
| @@ -14,6 +14,7 @@ | @@ -14,6 +14,7 @@ | ||
| 14 | use yii\web\Controller; | 14 | use yii\web\Controller; |
| 15 | use yii\web\NotFoundHttpException; | 15 | use yii\web\NotFoundHttpException; |
| 16 | use yii\filters\VerbFilter; | 16 | use yii\filters\VerbFilter; |
| 17 | + use yii\filters\AccessControl; | ||
| 17 | 18 | ||
| 18 | /** | 19 | /** |
| 19 | * OrderController implements the CRUD actions for Order model. | 20 | * OrderController implements the CRUD actions for Order model. |
| @@ -32,6 +33,22 @@ | @@ -32,6 +33,22 @@ | ||
| 32 | 'delete' => [ 'POST' ], | 33 | 'delete' => [ 'POST' ], |
| 33 | ], | 34 | ], |
| 34 | ], | 35 | ], |
| 36 | + 'access' => [ | ||
| 37 | + 'class' => AccessControl::className(), | ||
| 38 | + 'rules' => [ | ||
| 39 | + [ | ||
| 40 | + 'actions' => [ | ||
| 41 | + 'login', | ||
| 42 | + 'error', | ||
| 43 | + ], | ||
| 44 | + 'allow' => true, | ||
| 45 | + ], | ||
| 46 | + [ | ||
| 47 | + 'allow' => true, | ||
| 48 | + 'roles' => [ '@' ], | ||
| 49 | + ], | ||
| 50 | + ], | ||
| 51 | + ], | ||
| 35 | ]; | 52 | ]; |
| 36 | } | 53 | } |
| 37 | 54 |
controllers/OrderProductController.php
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | use yii\web\Controller; | 8 | use yii\web\Controller; |
| 9 | use yii\web\NotFoundHttpException; | 9 | use yii\web\NotFoundHttpException; |
| 10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
| 11 | + use yii\filters\AccessControl; | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * OrderProductController implements the CRUD actions for OrderProduct model. | 14 | * OrderProductController implements the CRUD actions for OrderProduct model. |
| @@ -26,6 +27,22 @@ | @@ -26,6 +27,22 @@ | ||
| 26 | 'delete' => [ 'POST' ], | 27 | 'delete' => [ 'POST' ], |
| 27 | ], | 28 | ], |
| 28 | ], | 29 | ], |
| 30 | + 'access' => [ | ||
| 31 | + 'class' => AccessControl::className(), | ||
| 32 | + 'rules' => [ | ||
| 33 | + [ | ||
| 34 | + 'actions' => [ | ||
| 35 | + 'login', | ||
| 36 | + 'error', | ||
| 37 | + ], | ||
| 38 | + 'allow' => true, | ||
| 39 | + ], | ||
| 40 | + [ | ||
| 41 | + 'allow' => true, | ||
| 42 | + 'roles' => [ '@' ], | ||
| 43 | + ], | ||
| 44 | + ], | ||
| 45 | + ], | ||
| 29 | ]; | 46 | ]; |
| 30 | } | 47 | } |
| 31 | 48 |
controllers/PaymentController.php
| @@ -8,6 +8,7 @@ | @@ -8,6 +8,7 @@ | ||
| 8 | use yii\web\Controller; | 8 | use yii\web\Controller; |
| 9 | use yii\web\NotFoundHttpException; | 9 | use yii\web\NotFoundHttpException; |
| 10 | use yii\filters\VerbFilter; | 10 | use yii\filters\VerbFilter; |
| 11 | + use yii\filters\AccessControl; | ||
| 11 | 12 | ||
| 12 | /** | 13 | /** |
| 13 | * PaymentController implements the CRUD actions for Payment model. | 14 | * PaymentController implements the CRUD actions for Payment model. |
| @@ -34,6 +35,22 @@ | @@ -34,6 +35,22 @@ | ||
| 34 | 'delete' => [ 'POST' ], | 35 | 'delete' => [ 'POST' ], |
| 35 | ], | 36 | ], |
| 36 | ], | 37 | ], |
| 38 | + 'access' => [ | ||
| 39 | + 'class' => AccessControl::className(), | ||
| 40 | + 'rules' => [ | ||
| 41 | + [ | ||
| 42 | + 'actions' => [ | ||
| 43 | + 'login', | ||
| 44 | + 'error', | ||
| 45 | + ], | ||
| 46 | + 'allow' => true, | ||
| 47 | + ], | ||
| 48 | + [ | ||
| 49 | + 'allow' => true, | ||
| 50 | + 'roles' => [ '@' ], | ||
| 51 | + ], | ||
| 52 | + ], | ||
| 53 | + ], | ||
| 37 | ]; | 54 | ]; |
| 38 | } | 55 | } |
| 39 | 56 |