S
S
Sergey Beloventsev2016-05-23 23:34:42
Yii
Sergey Beloventsev, 2016-05-23 23:34:42

Why are there problems with authorization?

here is the entry rule

'rules' => [
    
                        [
                            'actions' => ['logout', 'index'],
                            'roles' => ['@'],
                        ],
                       [
                            'allow' => true,
                            'roles' => ['Superadmin'],
                        ],
                        [
                            'allow' => true,
                            'roles' => ['admin'],
                        ],
                    ],
                ],

if I go super admin I get
Forbidden (#403)
    
    Вам не разрешено производить данное действие.

if not an admin and not a superadmin, a white screen with an exception falls out . I would like that when superadmin and admin log in, the page simply opens and other users are sent to site/login

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Arutyunov, 2016-05-24
@arutyunov

AccessControl configured? Is there information about AccessControl in the config? What about controllers? What if I find it?
Admin and super admin how are you implemented? Through RBAC? Is RBAC configured correctly?
How does Yii determine which group is assigned to a logged in user? Have you overridden AccessRule?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question