Skip to content

Conversation

@danxuliu
Copy link
Member

@danxuliu danxuliu commented Dec 9, 2025

If the current user belongs to both one or more groups excluded from sharing and one or more groups not excluded from sharing the user is allowed to share. However, in the contacts menu, as soon as the current user belonged to a group excluded from sharing the user could not search for local contacts. This has been unified now with the sharing behaviour, so local contacts can still be searched if the user also belongs to a group not excluded from sharing (or to no group at all, which was also allowed before).

Important

Being able to share if the current user belongs to both groups excluded from sharing and other groups has been there since handling excluded groups was added for sharing. There is unfortunately no context about it (it seems to predate Nextcloud). However, unifying the behaviour between sharing and contacts menu to be like in the contacts menu (that is, preventing sharing) could be a breaking behaviour change.

On the other hand, not showing the contacts when belonging to both groups excluded from sharing and other groups was an explicit decision when adding handling of excluded groups for contacts. However, it might be just a cautious implementation to fix the issues described in #5107, and in any case it does not prevent finding other local users due to those users appearing as internal share candidates. Therefore, unifying the behaviour to show the contacts when belonging to both excluded and not excluded groups should not be problematic... but please double check that I did not miss anything :-)

How to test

  • Create user target
  • Create groups excluded and other
  • Create user searcher and add it to both groups
  • Exclude group excluded from sharing:
occ config:app:set core shareapi_exclude_groups --type string --value yes
occ config:app:set core shareapi_exclude_groups_list --type array --value '["excluded"]'
  • Log in as user searcher
  • Open the Files app
  • Open the Sharing tab for a file
  • In the internal shares, search for target; it should appear
  • In the contacts menu, search for target

Result with this pull request

User Target appears in the contacts menu, just like in the share candidates

Result without this pull request

User Target does not appear in the contacts menu

If the current user belongs to both one or more groups excluded from
sharing and one or more groups not excluded from sharing the user is
allowed to share. However, in the contacts menu, as soon as the current
user belonged to a group excluded from sharing the user could not search
for local contacts. This has been unified now with the sharing
behaviour, so local contacts can still be searched if the user also
belongs to a group not excluded from sharing (or to no group at all,
which was also allowed before).

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
@danxuliu danxuliu added this to the Nextcloud 33 milestone Dec 9, 2025
@danxuliu
Copy link
Member Author

danxuliu commented Dec 9, 2025

/backport to stable32

@danxuliu
Copy link
Member Author

danxuliu commented Dec 9, 2025

/backport to stable31

@danxuliu danxuliu marked this pull request as ready for review December 9, 2025 21:49
@danxuliu danxuliu requested review from ArtificialOwl, CarlSchwan, icewind1991 and leftybournes and removed request for a team December 9, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants