]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Убрал кнопку создания для того у кого нет разрешения
authorfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 8 Nov 2024 11:04:59 +0000 (14:04 +0300)
committerfomichev <vladimir.fomichev@erp-flowers.ru>
Fri, 8 Nov 2024 11:04:59 +0000 (14:04 +0300)
erp24/views/crud/employee-payment/index.php
erp24/views/crud/employee-payment/view.php

index c748cb30209e93763f8bb0b0ffd858708a3d343b..ee7fd12541ba377d2a5ce9d83665fc4e3dde11cc 100755 (executable)
@@ -17,7 +17,11 @@ $this->params['breadcrumbs'][] = $this->title;
 <div class="employee-payment-index p-4">
 
     <h1><?= Html::encode($this->title) ?></h1>
-    <?= Html::a('Добавить нового сотрудника', ['create'], ['class' => 'btn btn-success mb-4']) ?>
+
+    <?php if (Yii::$app->user->identity && Yii::$app->user->identity->hasPermission('employee-paymentEdit')): ?>
+        <?= Html::a('Добавить нового сотрудника', ['create'], ['class' => 'btn btn-success mb-4']) ?>
+    <?php endif; ?>
+
     <?php Pjax::begin(); ?>
     <?php echo $this->render('_search', ['model' => $searchModel]); ?>
 
index 3fb91c906b99fac8018441feaaf5b4f7f241b9b9..a2cf5b8a851720bf8e6ecd9da1a7bccf4fae8f26 100755 (executable)
@@ -21,7 +21,10 @@ $this->params['breadcrumbs'][] = $this->title;
     <h1><?= Html::encode($this->title) ?></h1>
 
     <p>
-        <?= Html::a('Добавить запись', ['create', 'admin_id' => $admin->id], ['class' => 'btn btn-success']) ?>
+        <?php if (Yii::$app->user->identity && Yii::$app->user->identity->hasPermission('employee-paymentEdit')): ?>
+            <?= Html::a('Добавить запись', ['create', 'admin_id' => $admin->id], ['class' => 'btn btn-success']) ?>
+        <?php endif; ?>
+
         <?= Html::a('Назад', ['index'], ['class' => 'btn btn-danger']) ?>
     </p>