Impossibile run Action Delete: errore 403 forbidden

Hi there,

I have a site developed in Yii 1.1 and I can’t delete anything.

The accessRules are set for each controller. In addition, I performed the following tests:

  • if I call the delete action (the classic action created by Yii) I get 403 Forbidden error.

  • if I insert a line of code like this "$ this-> loadModel (2) -> delete ();" in actionIndex the delete is performed.

  • if I create a new action called Index2 and execute "$ this-> loadModel (2) -> delete ();" the delete is performed.

  • if the new action called Index2 has an input parameter I get 400 Bad Request error.

What do you suggest me to do? Thanks in advance.

What access rules are in place?

What does your delete action look like?

Thanks for the reply.

Initially, the delete action was:

public function actionDelete($id) {


    // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser

    if (!isset($_GET['ajax']))

        $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));


Now, I have changed like:

public function actionCancel(){

    if (isset($_POST['id'])) {

        $result = $this->loadModel($_POST['id'])->delete();

        echo $result;



and it works, but I don’t understand why.