oldrock
oldrock

Reputation: 871

Yii Error while accessing rights module

I get the following error while accessing the rights module,

 array_map() [<a href='function.array-map'>function.array-map</a>]: Argument #2 should be an array

i have enabled the rights module by adding proper configuration settings in the main.php file

Please can somebody help me out in fixing this issue

Upvotes: 1

Views: 448

Answers (1)

Sammaye
Sammaye

Reputation: 43884

It sounds as though your rights are not correctly defined within the controller.

So when the function goes through what would normally be after position [1] which is actions (since expression, roles and message all go into a different condition as you can see) allowed on the controller is it finding no array there.

I cannot be more specific about what is really happening without seeing your code but I suspects you have probably tried:

public function accessRules()
{
    return array(
        array('allow',
            'actions'=>'*',
            'users'=>array('?'),
        ),
    );
}

When infact I believe it should be:

public function accessRules()
{
    return array(
        array('allow',
            'actions'=>array('*'),
            'users'=>array('?'),
        ),
    );
}

Hope it helps,

Upvotes: 2

Related Questions