Skip to content

feat: option to exclude guest accounts from the everyone group - #39

Merged
icewind1991 merged 2 commits into
icewind1991:masterfrom
solracsf:feat/exclude-guests
Sep 20, 2026
Merged

icewind1991 merged 2 commits into
icewind1991:masterfrom
solracsf:feat/exclude-guests

Conversation

@solracsf

@solracsf solracsf commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #14

Adds occ group_everyone:exclude-guests [--on|--off] (off by default, so existing instances are unchanged).

  • Guests are recognised by the user backend name Guests (the Guests app), so there is no code dependency on that app.
  • Toggling dispatches UserRemovedEvent / UserAddedEvent for every guest. Without it, shares created while guests were excluded stay pending for them after --off, and other apps (Talk, etc.) never learn about the membership change.
  • searchInGroup removes guests using the guest backend's getDisplayNames() with the same search, limit and offset the user manager passes to every backend, so paging is unchanged.
  • countDisabledInGroup has no per-backend API, so it looks up each guest's enabled state when exclusion is on.

Tested on Nextcloud 35.0.0 RC4 with Guests and Activity enabled, on PostgreSQL 16 and MariaDB 11.8: unit tests, plus an end-to-end run covering group membership, counts, and a folder shared with everyone before and after --on/--off.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Comment thread lib/GroupBackend.php Outdated
Comment thread lib/GroupBackend.php Outdated
Comment thread lib/GroupBackend.php Outdated
- Detect the Guests user backend with instanceof instead of its name.
- Count disabled members from the disabled user list instead of loading
  every guest.
- Search only the non-guest backends when guests are excluded.

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@icewind1991
icewind1991 merged commit 661234b into icewind1991:master Sep 20, 2026
34 checks passed
@solracsf
solracsf deleted the feat/exclude-guests branch September 20, 2026 11:21
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.

group_everyone should exclude guest users

2 participants