E
E
EVOSandru62014-12-20 04:17:15
Yii
EVOSandru6, 2014-12-20 04:17:15

Why does yii kick out a user with the appropriate role in allow from the admin panel?

Good afternoon, according to Makarov's recipe, I completed yiiframework.ru/doc/cookbook/ru/access.rbac.file I
just replaced administrator, moderator .. in auth.php , everything except guest with integer indexes.

if(Yii::app()->user->checkAccess('3')){
    echo "hello, I'm administrator";
}

At authorization under the administrator fulfills. BUT the problem is in the PageController in the admin module. In accessRules() Exposed:
return array(
            array('allow',
                'actions'=>array('create, update, delete'),
                'roles'=>array('3'),
            ),
            array('deny',
                'users'=>array('*'),
            ),
        );

those. but to me, even authorized under the administrator, I throw out
Error 403
You do not have enough rights to perform the specified action.

If I remove:
array('deny',
                'users'=>array('*'),
            ),

That of course does not throw out, but this is not an option.
What could be the reason for the conflict?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Papa, 2014-12-20
@EVOSandru6

Your code:

...
'actions'=>array('create, update, delete'),
...

change to
'actions'=>array('create', 'update', 'delete'),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question