Ajax lock not created due to strict permission checks

Created on 19 January 2018, over 6 years ago
Updated 22 March 2024, 6 months ago

In ContentLockController only the update access is checked, which is generally okay and its not a security issue. As the only thing which happens is that no content lock is created. Which then could lead to an issue because you expected it to be created ;)

But this is fixed to:

return $entity->access('update', $account, TRUE);

Now there could be a second form operation, e.g to manage workflow on this node or to manage only some partial fields of the node.
These form operations can have separate permissions.

If a user without "node.update" permission is on the workflow form the content lock module tries to create a lock, which fails as the user doesn't have the "node.update" permission. In this case we do not need to check "node.update" we need to check permission of the form.

The problem is already the edit form. As the form operation is named "edit" the permission for $entity->access() is called "update". So there is no clear way to get from the form operation to the access operation. Or do I miss something here?

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany kfritsche πŸ‡©πŸ‡ͺπŸ‡ͺπŸ‡Ί

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024