Skip to content

Commit

Permalink
Add canSupport rule to delete button on domain index
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed Nov 26, 2015
1 parent da3804b commit 5691294
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/grid/DomainGridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static function defaultColumns()
]) : '';
},
'delete' => function ($url, $model, $key) {
return in_array($model->state, ['ok', 'expired', 'outgoing'], true) ? Html::a('<i class="fa fa-trash-o"></i>' . Yii::t('yii', 'Delete'), $url, [
return in_array($model->state, ['ok', 'expired', 'outgoing'], true) && Yii::$app->user->can('support') ? Html::a('<i class="fa fa-trash-o"></i>' . Yii::t('yii', 'Delete'), $url, [
'title' => Yii::t('yii', 'Delete'),
'aria-label' => Yii::t('yii', 'Delete'),
'data' => [
Expand Down

0 comments on commit 5691294

Please sign in to comment.