added RBAC
This commit is contained in:
60
lib/User/resources/views/permission/index.php
Normal file
60
lib/User/resources/views/permission/index.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @var $dataProvider array
|
||||
* @var $this yii\web\View
|
||||
* @var $searchModel \Da\User\Search\PermissionSearch
|
||||
*/
|
||||
|
||||
use yii\grid\ActionColumn;
|
||||
use yii\grid\GridView;
|
||||
use yii\helpers\Url;
|
||||
|
||||
$this->title = Yii::t('user', 'Permissions');
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
?>
|
||||
|
||||
<?php $this->beginContent('@Da/User/resources/views/shared/admin_layout.php') ?>
|
||||
|
||||
<?= GridView::widget(
|
||||
[
|
||||
'dataProvider' => $dataProvider,
|
||||
'filterModel' => $searchModel,
|
||||
'layout' => "{items}\n{pager}",
|
||||
'columns' => [
|
||||
[
|
||||
'attribute' => 'name',
|
||||
'header' => Yii::t('user', 'Name'),
|
||||
'options' => [
|
||||
'style' => 'width: 20%'
|
||||
],
|
||||
],
|
||||
[
|
||||
'attribute' => 'description',
|
||||
'header' => Yii::t('user', 'Description'),
|
||||
'options' => [
|
||||
'style' => 'width: 55%'
|
||||
],
|
||||
],
|
||||
[
|
||||
'attribute' => 'rule_name',
|
||||
'header' => Yii::t('user', 'Rule name'),
|
||||
'options' => [
|
||||
'style' => 'width: 20%'
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => ActionColumn::className(),
|
||||
'template' => '{update} {delete}',
|
||||
'urlCreator' => function ($action, $model) {
|
||||
return Url::to(['/user/permission/' . $action, 'name' => $model['name']]);
|
||||
},
|
||||
'options' => [
|
||||
'style' => 'width: 5%'
|
||||
],
|
||||
]
|
||||
],
|
||||
]
|
||||
) ?>
|
||||
<?php $this->endContent() ?>
|
||||
Reference in New Issue
Block a user