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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pivica created an issue. See original summary.

pivica’s picture

Here 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.

miro_dietiker’s picture

Priority: Normal » Minor
Status: Needs review » Needs work

Hm.. 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.

miro_dietiker’s picture

Status: Needs work » Closed (won't fix)

Most common use cases investigated proof that

  • Locked Paragraphs should not be cloned by regular users
  • The lock should still remain after cloning

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.