Is there any method or option for ActionColumn that does something like:
$user->can($url)
I just want to show only buttons with permitted urls.
Is there any method or option for ActionColumn that does something like:
$user->can($url)
I just want to show only buttons with permitted urls.
I think you have to rewrite the 3 buttons :
[
'class' => 'yii\grid\ActionColumn',
//'visible' => $user->can(''),
'buttons' => [
'view' => function ($url, $model, $key) {
if(Yii::$app->user->can('') {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $url, [
'title' => Yii::t('yii', 'View'),
'data-pjax' => '0',
]);
}
};
]
]
I hope there is another way to do it.