Skip to content

refactor: Separate concerns in link sharing checks - #55821

Closed
nfebe wants to merge 2 commits into
masterfrom
refactor/separate-link-sharing-concerns
Closed

nfebe wants to merge 2 commits into
masterfrom
refactor/separate-link-sharing-concerns

Conversation

@nfebe

@nfebe nfebe commented Oct 17, 2025

Copy link
Copy Markdown
Contributor

Following #55811 split shareApiAllowLinks() into two dedicated methods to improve clarity
and separation of concerns:

  • isLinkSharingEnabled(): Checks if link sharing is globally enabled
  • canUserCreateLinkShares(): Checks if a user can create link shares
    (considers both global settings and group restrictions)

The original shareApiAllowLinks() is now deprecated and acts as a
wrapper to maintain backward compatibility.

nfebe added 2 commits October 16, 2025 15:53
When a logged-in user accesses a public share link in the same browser,
the system was incorrectly checking if that user's groups were excluded
from creating link shares. This caused share not found errors for users
in excluded groups, even though public shares should be accessible to anyone
with the link.

The group exclusion setting (`shareapi_allow_links_exclude_groups`) is
intended to restrict share creation, not share access. Public shares
are meant to be anonymous and accessible regardless of the viewer identity
or group membership.

Signed-off-by: nfebe <fenn25.fn@gmail.com>
Following #55811 split `shareApiAllowLinks()` into two dedicated methods to improve clarity
and separation of concerns:

- `isLinkSharingEnabled()`: Checks if link sharing is globally enabled
- `canUserCreateLinkShares()`: Checks if a user can create link shares
  (considers both global settings and group restrictions)

The original shareApiAllowLinks() is now deprecated and acts as a
wrapper to maintain backward compatibility.
@susnux

susnux commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

code will be removed as we migrate now to unified sharing

@susnux susnux closed this Sep 14, 2026
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.

2 participants