Skip to content

fix(usershareprovider): prevent setting an expiration on the last space manager - #992

Merged
butonic merged 3 commits into
opencloud-eu:workpackagesfrom
dragonchaser:backport-wp2-769
Nov 12, 2026
Merged

butonic merged 3 commits into
opencloud-eu:workpackagesfrom
dragonchaser:backport-wp2-769

Conversation

@dragonchaser

Copy link
Copy Markdown
Member

Setting an expiration on the last permanent space manager is now denied, so a space can no longer end up without a manager once the grant expires; includes regression specs.

dj4oC and others added 2 commits November 11, 2026 11:53
…ce manager

Setting an expiration on the last permanent manager of a space was
allowed, which left the space without any manager once the grant
expired. UpdateShare only ran the "is a permanent manager remaining"
check when the new permissions dropped the manager role. It now also
runs when the update gives the share an expiration, via the new
mayRemoveLastPermanentManager predicate, since an expiring manager is
not a permanent manager.
… check

A space needs at least one permanent manager, so giving a space root
share an expiration must be checked like downgrading its permissions.
@dragonchaser dragonchaser added the Type:Maintenance E.g. technical debt, packaging, etc. label Nov 11, 2026
@dragonchaser
dragonchaser marked this pull request as ready for review November 11, 2026 11:17
@dragonchaser

Copy link
Copy Markdown
Member Author

merge #993 first

Resolve the usershareprovider.go conflict in favour of opencloud-eu#993, which landed the same last manager expiration check first. Its mayRemoveLastPermanentManager is the more precise variant: it resolves the permissions and expiration an update leaves on the share, so only expiring managers trigger the check.

Drop this branch's specs that opencloud-eu#993 covers with the same or stronger scenarios and keep the one it lacks: an expiration in the payload is ignored when the update mask does not list it.

Co-authored-by: Copilot <[email protected]>
@butonic
butonic merged commit 59bd28f into opencloud-eu:workpackages Nov 12, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Maintenance E.g. technical debt, packaging, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants