Skip to content

[4.0.0-beta.1] none admin user can't save draft / entry in case of only one site. #10757

@mersy

Description

@mersy

Description

I installed 4.0.0-beta.1 and create new section with just title field only.
I added none admin user, and add permission for editing entry in the section.
When this none admin user create entry, can't save draft.
CleanShot 2022-03-16 at 08 37 58

And user save entry, show this error message.

User not authorized to edit content for this site.

Admin user can save draft and entry.

Occurs only when there is only one site.
I added one site and add permission for editing the site to none admin user , then the none admin user can save draft and create entry.

Steps to reproduce

  1. install 4.0.0-beta.1
  2. start PRO trial
  3. create a section
  4. create a new user not admin
  5. new user create entry

Additional info

  • Craft version: Craft Pro 4.0.0-beta.1
  • PHP version: 8.0.16
  • Database driver & version: MySQL 10.3.34
  • Plugins & versions: No plugins are enabled.
yii\web\ForbiddenHttpException: User not authorized to edit content for this site. in /home/swkbdufr/craft4-test/vendor/craftcms/cms/src/controllers/ElementsController.php:1490
Stack trace:
#0 /home/swkbdufr/craft4-test/vendor/craftcms/cms/src/controllers/ElementsController.php(1263): craft\controllers\ElementsController->_element()
#1 [internal function]: craft\controllers\ElementsController->actionApplyDraft()
#2 /home/swkbdufr/craft4-test/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#3 /home/swkbdufr/craft4-test/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#4 /home/swkbdufr/craft4-test/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('apply-draft', Array)
#5 /home/swkbdufr/craft4-test/vendor/craftcms/cms/src/web/Application.php(300): yii\base\Module->runAction('elements/apply-...', Array)
#6 /home/swkbdufr/craft4-test/vendor/craftcms/cms/src/web/Application.php(604): craft\web\Application->runAction('elements/apply-...', Array)
#7 /home/swkbdufr/craft4-test/vendor/craftcms/cms/src/web/Application.php(279): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#8 /home/swkbdufr/craft4-test/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#9 /home/swkbdufr/public_html/craft4-test/index.php(13): yii\base\Application->run()
#10 {main}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions