Remove clone permissions of non-cloneable entities

Created on 27 October 2023, almost 2 years ago
Updated 31 July 2024, about 1 year ago

Problem/Motivation

Since the cloneable entities configuration is added, entities can be removed from being cloneable. Yet, the permissions to clone them still exist after disabling them from cloning.

Steps to reproduce

Make entity of type "content" not cloneable. The permissions list still shows "Clone all Content entities.".

Proposed resolution

Remove the clone permission for each non-cloneable entity type.

Remaining tasks

Remove the clone permission for each non-cloneable entity type.

User interface changes

None.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇧🇪Belgium fernly

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

Merge Requests

Comments & Activities

  • Issue created by @fernly
  • First commit to issue fork.
  • Status changed to Needs review about 1 year ago
  • 🇸🇮Slovenia deaom

    The way this works with the MR is, in case a role has a permission set - Clone all content entities and on the clone entity config form the clone content is disabled, the role that had a permission no longer has it, it's removed. The permission Clone all content entities is still listed under /admin/people/permissions and can be set, even if the clone content is disabled. If the configuration then gets re-saved it is again removed from the role.
    I'm not sure if permission can actually be removed from the admin/people/permission, but it would probably be good to also check on the save permissions if the configuration to clone that entity is set, and if not, to not allow re-setting the permission, as the clone config form is usually not saved multiple times.

  • 🇮🇳India sandeep_k New Delhi

    @rajeshreeputra, I tried this MR !83 mergeable on Drupal 11.2, and I can still see "Clone all Content entities." under the permission tab.

  • Pipeline finished with Failed
    12 days ago
    Total: 254s
    #585038
  • 🇸🇮Slovenia deaom

    The tests are failing because of the action module no longer being in core, once the issue 💬 Add action module as dev dependency. Active is merged, the test should be re-run and possible test issues solved.
    The permissions are now removed from the admin/people/permissions list, based on the clone entity settings form. Needs review, so leaving status as is. Branch is re-based.

  • Pipeline finished with Failed
    12 days ago
    Total: 715s
    #585050
  • 🇮🇳India sandeep_k New Delhi

    I have retested this after applying this updated MR !83 mergeable on Drupal 11.2, The fix is working for me now. After applying the patch, the "Clone all Content entities." permissions are not available/ removed.
    I checked after enabling the Content configuration, and the permissions are available after the changes. Added both the results. RTBC++

  • 🇮🇳India rajeshreeputra Pune

    💬 Add action module as dev dependency. Active is merged so tests should pass now.

  • Pipeline finished with Success
    6 days ago
    Total: 195s
    #589856
  • Pipeline finished with Success
    6 days ago
    Total: 189s
    #589873
  • 🇸🇮Slovenia deaom

    Tests are now passing, there was also a manual review. Will leave status to RTBC, but fell free to change if needed.

Production build 0.71.5 2024