Prevent content from being deleted when there is an active workspace

Created on 4 November 2019, over 4 years ago
Updated 26 March 2024, 3 months ago

Problem/Motivation

This problematic behavior was discovered by @dixon_ in #3062486-33: Add the ability to create sub-workspaces in order to enable the dev -> stage -> live workflow for content β†’ :

While revision changes are contained in separate workspaces, deleting a node affects all workspaces.

Proposed resolution

When a workspace is active, the user should only be allowed to delete workspace-specific content, for example new entities or pending revisions for existing entities that were only created in that workspace.

Remaining tasks

TBD.

User interface changes

The "Delete" operation will be hidden from the UI for users that don't have a global "bypass content access" permissions. For users with restricted permissions but who are still able to access the entity deletion page, the form will display a message that the entity can not be deleted in that workspace and the Delete button will be disabled.

API changes

Deleting non-workspace-specific content from a workspace will throw an exception.

Data model changes

\Drupal\workspaces\WorkspaceAssociation::getAssociatedRevisions() will also return default revisions for entities that were created in a workspace.

Release notes snippet

TBD.

πŸ› Bug report
Status

Fixed

Version

10.3 ✨

Component
WorkspacesΒ  β†’

Last updated 16 days ago

No maintainer
Created by

πŸ‡·πŸ‡΄Romania amateescu

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

Merge Requests

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.69.0 2024