Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When lockable plugin is activated on some paragraph item then user without appropriate permissions should not be able to edit or remove that paragraph item. This works fine but in addition that user will also use the ability to use Duplicate action. The reason for this is because currently Duplicate action is checking for 'update' access on locked paragraph item which is too much.
Proposed resolution
Allow duplicate action on locked items.
Comment | File | Size | Author |
---|---|---|---|
#2 | allow-duplicate-on-locked-items-2876643-2.patch | 1.12 KB | pivica |
Comments
Comment #2
pivica CreditAttribution: pivica at MD Systems GmbH commentedHere is a patch that is checking 'view' operation on paragraph item and is also checking update operation on item parent if it's also a paragraph.
Comment #3
miro_dietikerHm.. When we discussed, it seemed so logical. Now i see all the complexity popping up.
If a user clones a locked element, the new element should be unlocked. Otherwise, the user might be unable to edit it. ;-)
The use case of element locking though is, to have a functional element present. If it is cloned, the new element is identical, likely needing a higher level of know-how to deal with it right (auch as placing a view, configuring placeholders, ..)
So yeah, while we could discuss showing the action, it needs test coverage of the advanced cases and more changes to workaround issues.
And for now, it's not a big limitation for users that locked paragraphs can't be cloned.
Comment #4
miro_dietikerMost common use cases investigated proof that
Cloning a Paragraph that is locked and later editable by the less privileged user needs case specific code (for instance, change the lock plugin flag, other field value change such as the published flag, ...).
Thus the current behavior is perfectly fine.