Skip to content

[stable32] fix(api): cleanly reject duplicate group assignment#4672

Merged
provokateurin merged 1 commit into
stable32from
backport/4668/stable32
May 11, 2026
Merged

[stable32] fix(api): cleanly reject duplicate group assignment#4672
provokateurin merged 1 commit into
stable32from
backport/4668/stable32

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented May 11, 2026

Backport of PR #4668

When the same group is POSTed twice to /folders/{id}/groups, the second
request hit a UNIQUE-constraint violation deep inside addApplicableGroup
and surfaced as an HTML 500 page that crashed XML clients (#2180).

Pre-check the folder's existing groups (already loaded by
checkedGetFolder) and throw OCSBadRequestException with a clear message
when the group is already assigned. The existing OCS framework turns
that into a well-formed XML/JSON error response, matching the pattern
the controller already uses for duplicate mount points (line 229) and
duplicate folder names elsewhere in the file.

Closes #2180

Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Signed-off-by: provokateurin <kate@provokateurin.de>
@backportbot backportbot Bot requested a review from provokateurin May 11, 2026 09:02
@backportbot backportbot Bot added the 3. to review Items that need to be reviewed label May 11, 2026
@backportbot backportbot Bot added this to the Nextcloud 32 milestone May 11, 2026
@provokateurin provokateurin enabled auto-merge May 11, 2026 09:10
@provokateurin provokateurin merged commit 39a82b1 into stable32 May 11, 2026
57 of 59 checks passed
@provokateurin provokateurin deleted the backport/4668/stable32 branch May 11, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Items that need to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants