AccessRules when using expressions not working

the part where is check isGuest works,

the other stuff doesn’t (the getState stuff)

first i used $user instead of Yii::app()->user but that makes no difference, both should be exactly the same

anyone got any idea what i’m doing wrong ?




	public function filters()

	{

		return array(

			'accessControl', // perform access control for CRUD operations

		);

	}




	public function accessRules()

	{

		return array(

			array('deny',  // deny all users who are not logged in, in the first place

				'expression'=>'$user->isGuest',

				'message'=>'U bent niet ingelogd.',

			),

			array('deny',  // deny all users who can't login 

				'expression'=>'!Yii::app()->user->getState("is_login")',

				'message'=>'U hebt geen toegang om in te loggen. Contacteer een beheerder als dit niet zo hoort te zijn.',

			),

			array('allow', // allow authenticated user to perform following actions

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

				'expression'=>'!Yii::app()->user->getState("is_gids")',

				'message'=>'U hebt onvoldoende toegang voor deze pagina of actie uit te voeren.',

			),

			array('allow', // allow authenticated user to perform following actions

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

				'expression'=>'Yii::app()->user->getState("is_beheerder") && !Yii::app()->user->getState("is_gids")',

				'message'=>'U hebt onvoldoende toegang voor deze pagina of actie uit te voeren.',

			),

			

		);

	}



I think you should specify who should allow and who should deny.




public function accessRules()

{

	return array(

		array('deny',  // deny all users who are not logged in, in the first place

			'expression'=>'$user->isGuest',

			'message'=>'U bent niet ingelogd.',

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

		),		

	);

}