Answer the question
In order to leave comments, you need to log in
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; ?>
<?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
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 questionAsk a Question
731 491 924 answers to any question