yii2-usuario icon indicating copy to clipboard operation
yii2-usuario copied to clipboard

Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()); returns a empty array

Open maxxer opened this issue 3 years ago • 2 comments

for some days after a update $roles = Yii::$app->authManager->getRolesByUser(Yii::$app->user->getId()); returns a empty array

Originally posted by @EndErr in https://github.com/2amigos/yii2-usuario/issues/442#issuecomment-1052043485

maxxer avatar Feb 28 '22 07:02 maxxer

@MatteoF96 could this be related to your recent commits?

maxxer avatar Feb 28 '22 07:02 maxxer

Please check you have this in your config:

        'authManager' => [
            'class' => 'Da\User\Component\AuthDbManagerComponent',
        ],

I had a similar issue which was caused by the default config to use yii\rbac\DbManager (advanced template); struggled with it for almost a day 😓

squio avatar Jun 13 '23 20:06 squio