Php 删除功能不起作用-Yii
我正在YII建设一个站点。 我为我的一个控制器制作了一个类似删除的功能。 我已经像这样定义了我的访问规则Php 删除功能不起作用-Yii,php,yii,yii-events,Php,Yii,Yii Events,我正在YII建设一个站点。 我为我的一个控制器制作了一个类似删除的功能。 我已经像这样定义了我的访问规则 public function accessRules() { return array( array('allow', // allow authenticated user to perform 'create' and 'update' actions 'actions'=>array('index', 'create', 'del
public function accessRules()
{
return array(
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('index', 'create', 'delete', 'update'),
'users'=>array('*'),
),
array('deny',
'users' => array('*'),
),
);
}
即使在登录之后,如果我尝试访问删除功能,也会出现此错误
CHttpException
You are not authorized to perform this action. (C:\xampp\htdocs\framework\web\auth\CAccessControlFilter.php:170)
谁能告诉我我做错了什么
public function accessRules()
{
return array(
array('allow', // allow authenticated user to perform 'create' and 'update' actions
'actions'=>array('index', 'create', 'delete', 'update'),
'users'=>array('@'),
),
array('deny',
'users' => array('*'),
),
);
}
Simple Thing you are allowing for all user and also deny for all user then how it will be work now login with demo/demo or admin/admin you can delete