yiisoft / yii2-debug

Debug Extension for Yii 2
http://www.yiiframework.com
BSD 3-Clause "New" or "Revised" License
202 stars 149 forks source link

Switching user back to admin user is not possible when using access rules #523

Open Renkas opened 10 months ago

Renkas commented 10 months ago

What steps will reproduce the problem?

Have user panel set up with roles filter because we only want to allow admin users to have this functionality

            'user' => [
                'class' => \yii\debug\panels\UserPanel::class,
                'ruleUserSwitch' => [
                    'allow' => true,
                    'roles' => ['root'],
                ],
            ],

What's expected?

User switching works fine. But when I switch to another user that does not have root role I have a possibility to switch back to my own user.

What do you get instead?

I'm stuck with the user i switched to.

Additional info

There should always be possibility to go back to your own original user regardless of access controls you set for the functionality.

Q A
Yii version 2.0.49
PHP version 8.2.11
Operating system Debian