Skip to content

feat: [OCISDEV-949] add option to disable direct (user/group) sharing#651

Merged
mzner merged 2 commits into
mainfrom
feat/OCISDEV-949/disable-direct-sharing
Jul 9, 2026
Merged

feat: [OCISDEV-949] add option to disable direct (user/group) sharing#651
mzner merged 2 commits into
mainfrom
feat/OCISDEV-949/disable-direct-sharing

Conversation

@mzner

@mzner mzner commented Jul 8, 2026

Copy link
Copy Markdown

Adds an enable_user_sharing config option to the ocs, usershareprovider and ocmshareprovider services. Defaults to true.

When set to false:

  • usershareprovider.CreateShare and ocmshareprovider.CreateOCMShare reject
    requests to share a resource with a user, group, or federated (remote) user.
    Public link sharing is not affected.
  • The legacy /apps/files_sharing/api/v1/sharees search endpoint returns an
    empty result set instead of searching users/groups.
  • The files_sharing.user.enabled capability is set to false, so clients
    can hide the corresponding UI.

This is consumed by a corresponding oCIS change that wires the new option to
an OCIS_ENABLE_USER_SHARING config toggle.

Adds an `enable_user_sharing` config option to the ocs, usershareprovider
and ocmshareprovider services. Defaults to true. When set to false, the
usershareprovider and ocmshareprovider gRPC services reject requests to
share a resource with a user, group, or federated (remote) user. The
sharees search endpoint returns no results, and the
files_sharing.user.enabled capability is set to false. Public link
sharing is not affected.
@mzner mzner requested review from 2403905, kobergj and mklos-kw July 8, 2026 09:34
@mzner mzner requested a review from a team as a code owner July 8, 2026 09:34
@kw-security

kw-security commented Jul 8, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@mzner mzner force-pushed the feat/OCISDEV-949/disable-direct-sharing branch from 93d8380 to e5f68ae Compare July 8, 2026 10:38
kobergj
kobergj previously requested changes Jul 9, 2026

@kobergj kobergj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one point. Rest looks good 👍

Comment thread internal/grpc/services/ocmshareprovider/ocmshareprovider.go Outdated
Comment thread internal/grpc/services/publicshareprovider/publicshareprovider.go Outdated
Comment thread internal/http/services/owncloud/ocs/ocs.go Outdated
@mzner mzner force-pushed the feat/OCISDEV-949/disable-direct-sharing branch 2 times, most recently from 643be4e to 91ad80f Compare July 9, 2026 13:07
Adds an enable_public_sharing config option to the publicshareprovider
service, defaulting to true. When set to false, creating new public
links is rejected (internal links, which carry no permissions, are
unaffected). Also removes a hardcoded override in the capabilities
handler that always forced files_sharing.public.enabled to true,
letting it reflect whatever value is actually configured.
@mzner mzner force-pushed the feat/OCISDEV-949/disable-direct-sharing branch from 91ad80f to ab1424c Compare July 9, 2026 13:59
@mzner mzner dismissed kobergj’s stale review July 9, 2026 15:06

implemented

@mzner mzner merged commit a9d5432 into main Jul 9, 2026
16 checks passed
@mzner mzner deleted the feat/OCISDEV-949/disable-direct-sharing branch July 9, 2026 15:06
mzner added a commit to owncloud/ocis that referenced this pull request Jul 9, 2026
…e6f7f

Includes owncloud/reva#651, which adds the enable_user_sharing and
enable_public_sharing config options this feature depends on.
mzner added a commit to owncloud/ocis that referenced this pull request Jul 10, 2026
…e6f7f

Includes owncloud/reva#651, which adds the enable_user_sharing and
enable_public_sharing config options this feature depends on.
2403905 pushed a commit to owncloud/ocis that referenced this pull request Jul 10, 2026
* build(deps): [OCISDEV-949] bump reva to v2.0.0-20260709150645-a9d5432e6f7f

Includes owncloud/reva#651, which adds the enable_user_sharing and
enable_public_sharing config options this feature depends on.

* feat: [OCISDEV-949] add options to disable direct and public sharing

Adds two independent, per-deployment config options:

- OCIS_ENABLE_USER_SHARING (default true), read by the frontend, graph,
  sharing and ocm services. When false, creating new user, group or
  federated shares is rejected (via reva's usershareprovider and
  ocmshareprovider, and via the graph Invite endpoint for the modern web
  client), the legacy sharees search endpoint returns no results, and
  the files_sharing.user.enabled / user_enumeration.enabled capabilities
  report false so the web UI hides the "share with people" search.
  Space membership invites are exempt.

- OCIS_ENABLE_PUBLIC_SHARING (default true), read by the frontend and
  sharing services. When false, creating new public links is rejected
  via reva's publicshareprovider, and files_sharing.public.enabled
  reports false so the web UI hides public link creation.

The two settings are fully independent of each other.
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.

5 participants