Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 删除功能不起作用-Yii_Php_Yii_Yii Events - Fatal编程技术网

Php 删除功能不起作用-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

我正在YII建设一个站点。 我为我的一个控制器制作了一个类似删除的功能。 我已经像这样定义了我的访问规则

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