V
V
vitaly_742021-04-24 14:31:41
Yii
vitaly_74, 2021-04-24 14:31:41

Is it possible to find out the parent role of a user in Yii2?

I have 3 role groups, moderator, admin, and super admin.
for example, the user belongs to the role of "administrator", and of course he has access to the rights of "moderator"
and so. I'm doing a normal select, to switch the role of a user, in the select you need to specify in advance that the user is an administrator, so $user->can('administrator') and $user->can('moderator') will give the same result, and how to receive final "main" role of the user?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question