F
F
First Name2017-05-20 22:56:22
Yii
First Name, 2017-05-20 22:56:22

Ban on visiting the admin panel of a certain role in yii2?

Good day to all.
Task:
There are 2 roles: Low/High There is
an admin page with 1 drop-down list: Low/ High a person with the role "High" can enter the admin panel, a person with the role "Low" can also enter. How I did: Set the resolution to low view.

return [
    'hight' => [
        'type' => 1,

    ],
    'low' => [
        'type' => 1,
        'children' => [
            'view',
        ],
    ],
    'view' => [
        'type' => 2,
        'description' => 'view',
    ],
];

And I check for permission with the condition And then a stupor ... Where should I write the variable from the "low / high" drop-down list to give, take away the viewing right from the "High" role. And in general, what logic will be, what needs to be changed. not quite clear. Bad explanation, sorry. Hope you can help me, thanks in advance for your answers.
Yii::$app->user->can('view')

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
B_bird, 2017-06-01
@B_bird

In order not to make a bicycle, use the standard RBAC mechanism.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question