add role checking to controllers
This commit is contained in:
@@ -2,21 +2,24 @@
|
||||
|
||||
use yii\helpers\Html;
|
||||
use yii\widgets\DetailView;
|
||||
use common\components\RoleDefinition;
|
||||
|
||||
/* @var $this yii\web\View */
|
||||
/* @var $model common\models\User */
|
||||
|
||||
$this->title = $model->id;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Felhasználók'), 'url' => ['index']];
|
||||
$this->title = $model->username;
|
||||
$this->params['breadcrumbs'][] = ['label' => Yii::t('backend/user', 'Users'), 'url' => ['index']];
|
||||
$this->params['breadcrumbs'][] = $this->title;
|
||||
?>
|
||||
<div class="user-view">
|
||||
|
||||
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
||||
<?php if ( RoleDefinition::isAdmin()) {?>
|
||||
<p>
|
||||
<?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::a(Yii::t('backend/user', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
|
||||
</p>
|
||||
<?php }?>
|
||||
|
||||
<?= DetailView::widget([
|
||||
'model' => $model,
|
||||
|
||||
Reference in New Issue
Block a user