Hello,
I am on page http://www.yiiframew.../prototype.auth
I can successfully login to my mysql database users table.
However, when I try and create a new user, I am not authorized.
I do not see from the example, how to fix this.
Thanks
Page 1 of 1
Security Question Building Blog Tutorial
#3
Posted 21 July 2010 - 07:02 AM
zaccaria, on 21 July 2010 - 02:02 AM, said:
Edit public function accessRules() in your controller
Do you have an example?
Regards,
Frank
Frank
#4
Posted 21 July 2010 - 08:49 AM
Post the function rules of the controller that is not working, I will explain you how to fix
#5
Posted 21 July 2010 - 09:47 AM
/**
* @return array action filters
*/
public function filters()
{
return array(
'accessControl', // perform access control for CRUD operations
);
}
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function accessRules()
{
return array(
array('allow', // allow all users to perform 'index' and 'view' actions
'actions'=>array('index','view'),
'users'=>array('*'),
),
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('create','update'),
'users'=>array('@'),
),
array('allow', // allow admin user to perform 'admin' and 'delete' actions
'actions'=>array('admin','delete'),
'users'=>array('admin'),
),
array('deny', // deny all users
'users'=>array('*'),
),
);
}
Regards,
Frank
Frank
Share this topic:
Page 1 of 1

Help













