Problem/Motivation

https://www.youtube.com/watch?v=JoW8r1CLzwQ&t=10s
Matt Glaman suggested this as a bug with UMAMI and layout builder. An editor and author should be able to edit and configure the blocks they just created.

Steps to reproduce

Watch the video from 28:09 to see his explanation about it.

Proposed resolution

Add the following default permissions:

Author

  • Content - Article: Configure layout overrides for content items that the user can edit
  • Content - Basic page: Configure layout overrides for content items that the user can edit
  • Content - Recipe: Configure layout overrides for content items that the user can edit
  • Create and edit custom blocks

Editor

  • Content - Article: Configure layout overrides for content items that the user can edit
  • Content - Basic page: Configure layout overrides for content items that the user can edit
  • Content - Recipe: Configure layout overrides for content items that the user can edit
  • Create and edit custom blocks

Remaining tasks

  1. Manual testing (Novice)
  2. Sort permissions alphabetically (Novice): see Comment #17.

User interface changes

Users with the Author and/or Editor roles will be able to edit layouts in the Umami demo profile.

API changes

None

Data model changes

None

Issue fork drupal-3219967

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bernardm28 created an issue. See original summary.

bernardm28’s picture

Issue summary: View changes

bernardm28’s picture

Status: Active » Needs review
bernardm28’s picture

Issue summary: View changes
bernardm28’s picture

Issue summary: View changes

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

benjifisher’s picture

Issue summary: View changes
Issue tags: +Needs manual testing, +Novice, +Portland2022

Those permissions were added in #2914486: Add granular permissions to the Layout Builder. I agree that the Author and Editor roles in Umami should have these permissions.

I checked all three content types: Article, Basic page, Recipe. In all three, the Default view mode does not use Layout Builder, but the "Full content" view mode does: for example, /en/admin/structure/types/manage/article/display/full. In that view mode, all three content types allow individual nodes to override the default layout.

I reviewed the merge request, and it looks good, but I did not test.

A manual test should include at least the following:

  1. As a user with the Administrator role, check that the two roles have the expected permissions on /en/admin/people/permissions/module/layout_builder.
  2. As a user with the Author or Editor role, check that you can edit an existing layout: rearrange blocks and add new ones. For example, /en/node/18/layout.

I think the testing is a Novice task, so I am adding the issue tag for that.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

gxleano’s picture

Assigned: Unassigned » gxleano
gxleano’s picture

gxleano’s picture

I'll test it!

benjifisher’s picture

@gxleano:

Thanks for helping with this issue.

Whether or not the testing goes as expected, please give details about how you tested. A few screenshots would help: show the URL and the logged-in user, and perhaps the confirmation message after making changes.

gxleano’s picture

Version: 9.5.x-dev » 9.2.x-dev
Assigned: gxleano » Unassigned
Status: Needs review » Reviewed & tested by the community

Tested in version 9.2.1-dev, which is the branch the merge request is created against.

TEST RESULT (Step by step)

1. As an Admin user, go to /admin/people/permissions and check Layout builder permissions for Author and Editor roles.

The permissions below are automatically enabled to the Author and Editor roles:

  • Content - Article: Configure layout overrides for content items that the user can edit.
  • Content - Basic page: Configure layout overrides for content items that the user can edit.
  • Content - Recipe: Configure layout overrides for content items that the user can edit.
  • Create and edit custom blocks.

2. As an Admin user, go to /admin/structure/types/manage/article/display and enable "Use Layout Builder" option over Layout options.

3. As an Author and Editor user, try to edit the layout of his/him/their existing content (Article, Recipe or Basic Page).

Edited Layout of content /node/11/edit?destination=/en/admin/content, adding a Basic block (custom block) and everything is working as expected.

To sum up, the code into the MRs looks good to me, and it's working as expected.

benjifisher’s picture

Version: 9.2.x-dev » 10.1.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs manual testing

@gxleano:

Thanks for the testing. Your Comment #16 is just what I had in mind.

Since 9.2.x is not even supported anymore, this issue should really target 10.1.x. The core committers may decide to back-port it to 10.0.x and 9.5.x since it is not a disruptive change. (It affects only new installations of the Umami demo profile.)

I checked, and the patch (or diff) from the merge request applies cleanly to the 10.1.x branch.

I also noticed that, after applying the patch, the permissions are not in alphabetical order. I am sorry I missed that in #9. I am setting the status back to NW for that. I think that fixing the order is a Novice task, so I am leaving that issue tag. I am removing the tag for manual testing. After #16, I do not think we have to re-test.

gxleano’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Novice

I've created a merge request to 10.1.x adding the permissions ordered alphabetically.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work

It looks like CI is failing for the MR.

joachim’s picture

  array (
    0 => '    - core.entity_view_display.node.article.full',
    1 => '    - core.entity_view_display.node.page.full',
    2 => '    - core.entity_view_display.node.recipe.full',
  ),

These are dependencies that are missing in the role config. Permissions now have dependencies (https://www.drupal.org/node/3055548) and so giving a role a permission for a node type means the role config entity has a dependency on the node type config entity.

(Aside: AssertConfigTrait::assertConfigDiff() should be converted to a PHPUnit custom assertion, and uuuuurgh the Drupal\Component\Diff component has no documentation!!!!)

gxleano’s picture

Status: Needs work » Needs review
gxleano’s picture

Status: Needs review » Needs work
gxleano’s picture

I've fixed the Demo Umami test, but now it seems to be unstable with FunctionalJavascript test in CKEditor 5.

gxleano’s picture

Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Reviewed & tested by the community

LGTM!

longwave’s picture

Title: Layout Builder Role Permissions Update UMAMI » Allow authors and editors to edit page layouts in Umami

Updating title, and saving issue credit.

longwave’s picture

Status: Reviewed & tested by the community » Fixed

Backported to 10.0.x/9.5.x as a low risk bug fix; the config change only affects newly installed demo sites.

Committed and pushed f0269a4896 to 10.1.x and 6f2b88b8dc to 10.0.x and 3d51469370 to 9.5.x. Thanks!

  • longwave committed 6f2b88b8 on 10.0.x
    Issue #3219967 by gxleano, bernardm28, benjifisher, joachim: Allow...

  • longwave committed f0269a48 on 10.1.x
    Issue #3219967 by gxleano, bernardm28, benjifisher, joachim: Allow...

  • longwave committed 3d514693 on 9.5.x
    Issue #3219967 by gxleano, bernardm28, benjifisher, joachim: Allow...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.