Hi folks. My Yii2 site worked perfectly on my local machine, however since I’ve uploaded it to the production server I’m getting some odd issues.
The problem is that, while I can add a record using the system, I can’t delete or even view the record once it’s created. The error is 403 “You are not allowed to perform this action.”
I was using the below ‘access’ rules in my SiteController but I still have the issue even when this section is commented out.
'access' => [
'class' => AccessControl::className(),
'only' => ['logout', 'signup', 'create', 'edit', 'index'],
'rules' => [
[
'actions' => ['show'],
'allow' => true,
'roles' => ['?'],
],
[
'actions' => ['index', 'logout', 'create', 'edit'],
'allow' => true,
'roles' => ['@'],
],
],
],
I can see the main "index" of each view fine, but trying to "view", "update" or "delete" is not working. As I said, "add" works, but then when it takes me to the "view" action after adding, I get the 403.
If anyone can help me get to the bottom of this issue I’d really appreciate it.