From: fomichev Date: Tue, 5 Nov 2024 15:00:27 +0000 (+0300) Subject: Добавил правила захода враздел X-Git-Tag: 1.6~26^2 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=1b9edec88ede18bdfb3fb55dc6d0e35bdaca9c7e;p=erp24_rep%2Fyii-erp24%2F.git Добавил правила захода враздел --- diff --git a/erp24/controllers/crud/EmployeePaymentController.php b/erp24/controllers/crud/EmployeePaymentController.php index e53eb98a..7876fd71 100755 --- a/erp24/controllers/crud/EmployeePaymentController.php +++ b/erp24/controllers/crud/EmployeePaymentController.php @@ -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' => [