Using accessControl

This code is valid to restrict this Controller for memeber only? (sorry for my english)


<?php 

 /**

 * 

 */

 class PrivateController extends Controller

 {

 	

 	public function filters()

    {

        return array(

            'accessControl',

        );

    }


    function actionIndex()

 	{

 		

	 	$this->render('index');

	 	


 		

 	}




 }




 ?>

Seems not work. I can access without login…I read the guide and some tutorials but there is something that I do wrong.

Tranks.

You also have to add an access rule.

/Tommy

You should add access rules.

For example:




	public function accessRules()

	{

		return array(

			array('allow', // allow authenticated user to perform 'create' and 'update' actions

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

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

			),

			array('deny',  // deny all users

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

			),

		);

	}




Perfect, thanks!!