Access Rules Not Working Properly

I have problem with access control. I have rule:


array('deny', 

                'actions'=>array('index'),

                'expression'=>'Yii::app()->user->isRegistered()',

                                'deniedCallback' => array($this->render('//site/info',array('message'=>'You must activate your account.')),Yii::app()->end()), 

            ),  

function:


public function isRegistered()

{

    return (Yii::app()->user->isGuest) ? FALSE : $this->level == 1;

}

If I login as admin and i have level 3, isRegistered() return false, but deniedCalback runs.

How to change this to run callback only when expression is true?

Hi

check the documentation of deniedCallback

http://www.yiiframework.com/doc/api/1.1/CAccessRule#deniedCallback-detail

try this


'deniedCallback' => array($this, 'ActionToSiteInfo'),