add role to user
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
use common\components\RoleDefinition;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $searchModel frontend\models\UserSearch */
|
||||
@@ -28,6 +29,15 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
'email:email',
|
||||
'created_at:datetime',
|
||||
|
||||
[
|
||||
'attribute' => 'role',
|
||||
'value' => function ($model){
|
||||
$roles = \Yii::$app->authManager->getRolesByUser($model->id );
|
||||
|
||||
return implode(', ', array_map(function ($role) { return sprintf("%s", RoleDefinition::getRoleLabel($role->name)); }, $roles ));
|
||||
}
|
||||
] ,
|
||||
|
||||
['class' => 'yii\grid\ActionColumn',
|
||||
'template' => '{view} {update}'
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user