]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавил правила захода враздел
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 5 Nov 2024 15:00:27 +0000 (18:00 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Tue, 5 Nov 2024 15:00:27 +0000 (18:00 +0300)
erp24/controllers/crud/EmployeePaymentController.php

index e53eb98ad1e057965a4655aebc522ff6d989b915..7876fd7179537743796de01e718a9a2d075b08f1 100755 (executable)
@@ -4,6 +4,7 @@ namespace yii_app\controllers\crud;
 
 use Yii;
 use yii\data\ActiveDataProvider;
+use yii\filters\AccessControl;
 use yii\helpers\ArrayHelper;
 use yii_app\records\Admin;
 use yii_app\records\EmployeePayment;
@@ -25,6 +26,19 @@ class EmployeePaymentController extends Controller
         return array_merge(
             parent::behaviors(),
             [
+                'access' => [
+                    'class' => AccessControl::class,
+                    'rules' => [
+                        [
+                            'allow' => true,
+                            'actions' => ['view', 'index', 'update', 'delete'],
+                            'roles' => ['menu/crud/employee-payment/','employee-paymentEdit'],
+                        ],
+                    ],
+                    'denyCallback' => function ($rule, $action) {
+                        throw new \yii\web\ForbiddenHttpException('У вас нет прав для выполнения данного действия.');
+                    }
+                ],
                 'verbs' => [
                     'class' => VerbFilter::class,
                     'actions' => [