Accessrules - Controller Available Only On Debug Mode

Hi,

I am trying to create a controller which is available only on debug mode.

i have done the following with no success:

public function accessRules() {


	return array(


		// not logged in users should be able to login and view captcha images as well as errors


		array(


                        'allow', 


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


                        'users'=> array('*'),


                        'expression' => "defined('YII_DEBUG')",


                        ),


		// logged in users can do whatever they want to

// array(‘allow’, ‘users’ => array(’@’)),

		// not logged in users can't do anything except above


		array('deny'),


	);


}

any help will be much appreciated

Hi

try something like this


public function accessRules() {

if (defined('YII_DEBUG')) {

return array(

    array(

     'allow', 

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

     'users'=> array('*'),

    ),

    array('deny'),

  );

} else {

   return array(array('deny'),); 

}

}