Skip to content

Prevent space managers from purging spaces#672

Merged
aduffeck merged 6 commits into
opencloud-eu:mainfrom
aduffeck:fix-1799
Jun 15, 2026
Merged

Prevent space managers from purging spaces#672
aduffeck merged 6 commits into
opencloud-eu:mainfrom
aduffeck:fix-1799

Conversation

@aduffeck

Copy link
Copy Markdown
Member

Managers can disable spaces but only admins can actually delete them.

Fixes opencloud-eu/opencloud#1799

aduffeck added 2 commits June 11, 2026 14:26
Managers can disable spaces but only admins can actually delete them.
aduffeck added 4 commits June 12, 2026 08:31
This should also fix some flakiness in the integration test suite where
the fallback identification mechanism only works when the parrent has
already been assimilated (which is racey).
@aduffeck
aduffeck merged commit 4f80dc9 into opencloud-eu:main Jun 15, 2026
19 checks passed
@micbar

micbar commented Jun 15, 2026

Copy link
Copy Markdown
Member

This needs a backport to both stable branches.

@rhafer

rhafer commented Jun 19, 2026

Copy link
Copy Markdown
Member

This needs a backport to both stable branches.

@micbar Are you sure? This is a pretty breaking change for stable-4.0. We even document that space managers are able to purge spaces: https://docs.opencloud.eu/docs/user/roles/space-roles

Backporting to stable-7.0 is of course fine.

michaelstingl added a commit to michaelstingl/opencloud-eu-reva that referenced this pull request Jun 27, 2026
The space index tests added in opencloud-eu#695 purge a project space as its owner
(a space manager) and expect success. opencloud-eu#672 later restricted managers to
disabling spaces, so that only a delete-all-spaces user may purge. The opencloud-eu#695
branch predated that change and was not rebased onto it, so a textually clean
merge left these three tests failing on main.

Purge as a delete-all-spaces user instead, matching the current permission
model. Disabling stays with the space manager. Test-only, no production change.
michaelstingl added a commit to michaelstingl/opencloud-eu-reva that referenced this pull request Jun 27, 2026
… restriction

The space index tests added in opencloud-eu#695 purge a project space as its owner (a
space manager) and expect success. opencloud-eu#672 later restricted managers to disabling
spaces, so that only a delete-all-spaces user may purge. The opencloud-eu#695 branch
predated that change and was not rebased onto it, so a textually clean merge
left these three tests failing on main.

Purge as a delete-all-spaces user in those tests, matching the current
permission model, and add the missing counterpart assertion: a space manager
may disable a project space but not purge it. Test-only, no production change.
michaelstingl added a commit to michaelstingl/opencloud-eu-reva that referenced this pull request Jul 6, 2026
Since opencloud-eu#672 a space manager may disable but not purge a project space.
The "can delete (purge) project spaces" context asserts only the denial
side ("fails as a space manager" purge); the positive counterpart, that a
manager may still disable, was untested. A regression breaking manager
disable would pass the suite unnoticed.

Add the counterpart It: create a fresh project space and disable it as
the space manager, expecting success (the shared space in BeforeEach is
already disabled, so the test uses its own). Test-only, no production
change.
rhafer pushed a commit that referenced this pull request Jul 7, 2026
Since #672 a space manager may disable but not purge a project space.
The "can delete (purge) project spaces" context asserts only the denial
side ("fails as a space manager" purge); the positive counterpart, that a
manager may still disable, was untested. A regression breaking manager
disable would pass the suite unnoticed.

Add the counterpart It: create a fresh project space and disable it as
the space manager, expecting success (the shared space in BeforeEach is
already disabled, so the test uses its own). Test-only, no production
change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabling and deleting Spaces with API when UI for disabling and deleting space is not shown in context menu

3 participants