Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: User is not authorized to perform this action #16284

Open
mariuswestgaard opened this issue Dec 5, 2024 · 1 comment
Open

[5.x]: User is not authorized to perform this action #16284

mariuswestgaard opened this issue Dec 5, 2024 · 1 comment
Labels

Comments

@mariuswestgaard
Copy link

mariuswestgaard commented Dec 5, 2024

What happened?

Description

The user I'm signed in with is Admin. But, I'm unable to remove a nested entry in a matrix field. I can update the content in the selected nested entry. The matrix can add max 1 entry. The entry type selected in the matrix is updateable after creating, but I can't remove the nested element. Whenever I click remove in the options for the field, I get the following error even though my user is Admin: User is not authorized to perform this action

Trace:

2024-12-05 21:07:09 [web.ERROR] [yii\web\HttpException:403] yii\web\ForbiddenHttpException: User is not authorized to perform this action in /app/backend/vendor/craftcms/cms/src/controllers/NestedElementsController.php:65
Stack trace:
#0 /app/backend/vendor/yiisoft/yii2/base/Controller.php(176): craft\controllers\NestedElementsController->beforeAction(Object(yii\base\InlineAction))
#1 /app/backend/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('delete', Array)
#2 /app/backend/vendor/craftcms/cms/src/web/Application.php(350): yii\base\Module->runAction('nested-elements...', Array)
#3 /app/backend/vendor/craftcms/cms/src/web/Application.php(649): craft\web\Application->runAction('nested-elements...', Array)
#4 /app/backend/vendor/craftcms/cms/src/web/Application.php(312): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#5 /app/backend/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#6 /app/backend/web/index.php(12): yii\base\Application->run()
#7 {main} {"memory":4049240,"exception":"[object] (yii\\web\\ForbiddenHttpException(code: 0): User is not authorized to perform this action at /app/backend/vendor/craftcms/cms/src/controllers/NestedElementsController.php:65)"} 

Steps to reproduce

  1. Login to the cms as an admin account.
  2. Add a matrix field to a sections entry type, and allow it to add max 1 entry type.
  3. Add the entry type to the matrix field in the entry, and save. It worked saving.
  4. Try to remove the nested entry type.
  5. It fails with the errors described.

Expected behavior

I would expect that the nested were deleted, and I could then add a new nested entry.

Actual behavior

I can't delete the nested entry.

Craft CMS version

5.5.5

PHP version

8.2

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

@i-just
Copy link
Contributor

i-just commented Dec 6, 2024

Hi, thanks for getting in touch! I’m not able to reproduce this.
What view mode is this matrix field using? Could you also please turn on the safeMode and see if you’re still getting the same behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants