Enable the Manage Permissions tab

Created on 24 March 2023, over 1 year ago
Updated 16 February 2024, 9 months ago

Problem/Motivation

If a site has many paragraph types and enables the Paragraphs Type Permissions module, then the list of permissions is hard to use. It would be easier to add the Manage Permissions tab for each paragraph type.

Steps to reproduce

Proposed resolution

  1. Make the per-type permissions depend on the paragraph type.
  2. Enable the Permissions form for each paragraph type.

See the change records

Since the entity type is defined in the main module, the submodule will have to alter the entity type definition.

Remaining tasks

User interface changes

Add the Permissions form for a paragraph type:

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Needs review

Version

1.0

Component

Module: Type Permissions

Created by

πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @benjifisher
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area
  • Assigned to igor mashevskyi
  • @igor-mashevskyi opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • Status changed to Needs work over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    @Igor Mashevskyi, thanks for working on this!

    I am not sure why the test failed. When I install the replicate module and run the test locally, it passes:

    $ ddev phpunit modules/contrib/paragraphs/tests/src/Functional/WidgetStable/ParagraphsReplicateEnableTest.php 
    PHPUnit 9.5.28 by Sebastian Bergmann and contributors.
    
    Testing Drupal\Tests\paragraphs\Functional\WidgetStable\ParagraphsReplicateEnableTest
    ...                                                                 3 / 3 (100%)
    
    Time: 00:11.404, Memory: 4.00 MB
    
    OK (3 tests, 114 assertions)
    
    HTML output was generated
    

    In addition to enabling the Permissions tab, the MR adds the dependency on the paragraph type (config entity) as described in the change record Permissions can define dependencies β†’ . I will add that to the issue description and let the maintainers decide whether they would like to do that in a separate issue. If so, then that should be a bug report, not a task. Either way, it might be worth adding a test that the permissions are removed if the paragraph type is removed.

    Oh, I remember: the Permissions form for the type uses config dependency to find the related permissions, so the dependencies have to be declared in order for the form to work.

    I tested manually by enabling the Paragraphs Library and Paragraphs Type Permissions modules. Going to /admin/structure/paragraphs_type, I found the "Manage Permissions" option in the drop button, and it led me to this page:

    I will make a few suggestions on the MR. I am setting the status to NW now.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    180 pass
  • πŸ‡¨πŸ‡¦Canada joelseguin Ontario, Canada

    @benjifisher - thanks for the patch! I had assumed this functionality was already part of Paragraphs until I noticed it wasn't. I think it's very helpful for site builders as it improves the authoring experience especially when making use of many Paragraphs. It also serves as a reminder to actually set permissions for any new Paragraph that is created.

    I tested the patch against the latest stable 1.x version and it worked without issues.

  • Status changed to Needs review 9 months ago
  • πŸ‡ΊπŸ‡ΈUnited States benjifisher Boston area

    @joelseguin: You are welcome. Technically, I just created the issue and reviewed the patch (or the merge request). Thank you for bumping this issue.

    @IgorMashevskyi: Sorry, I did not notice that you updated the MR. I regularly check for issues that have been updated, but not MRs. I will set the status to NR now, and I will try to have another look soon.

Production build 0.71.5 2024