H
H
hollanditkzn2017-05-25 14:44:03
Yii
hollanditkzn, 2017-05-25 14:44:03

Why is the rbac button highlighted in the role?

I have the system role, but it's not possible to hide the button for my role

<?php if(!Yii::$app->user->can('system') or !Yii::$app->user->can('shop')):?>
    <?= Html::a('Создать заказ', ['create'], ['class' => 'btn btn-success']) ?>
       	<?php endif; ?>

So that I do not paint every role
<?php if(!Yii::$app->user->can('system') or !Yii::$app->user->can('shop')):?>
    <?= Html::a('Создать заказ', ['create'], ['class' => 'btn btn-success']) ?>
       	<?php endif; ?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-05-25
@webinar

2 identical pieces of code?
create a rule for rbac "createOrder" and connect it to the shop and system roles.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question