From 5691294d6efc3cf05a594a5b97910a90c9a695d0 Mon Sep 17 00:00:00 2001 From: Andrey Klochok Date: Thu, 26 Nov 2015 17:39:21 +0200 Subject: [PATCH] Add canSupport rule to delete button on domain index --- src/grid/DomainGridView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/grid/DomainGridView.php b/src/grid/DomainGridView.php index 83b19c76..250fa5e9 100644 --- a/src/grid/DomainGridView.php +++ b/src/grid/DomainGridView.php @@ -164,7 +164,7 @@ public static function defaultColumns() ]) : ''; }, 'delete' => function ($url, $model, $key) { - return in_array($model->state, ['ok', 'expired', 'outgoing'], true) ? Html::a('' . Yii::t('yii', 'Delete'), $url, [ + return in_array($model->state, ['ok', 'expired', 'outgoing'], true) && Yii::$app->user->can('support') ? Html::a('' . Yii::t('yii', 'Delete'), $url, [ 'title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data' => [