Skip to content

fix(sharing): Allow public share access for everyone - #55811

Merged
nfebe merged 1 commit into
masterfrom
fix/public-share-group-exclusion-access
Dec 2, 2025
Merged

fix(sharing): Allow public share access for everyone#55811
nfebe merged 1 commit into
masterfrom
fix/public-share-group-exclusion-access

Conversation

@nfebe

Copy link
Copy Markdown
Contributor

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.

@nfebe
nfebe requested a review from a team as a code ownerOctober 16, 2025 13:55
@nfebe
nfebe requested review from Altahrim, provokateurin and yemkareems and removed request for a teamOctober 16, 2025 13:55
@github-project-automationgithub-project-automationBot moved this to 🏗️ In progress in 📁 Files teamOct 16, 2025
@nfebenfebe added the 3. to review Waiting for reviews label Oct 16, 2025
@nfebe
nfebe requested a review from artongeOctober 17, 2025 09:12
nfebe added a commit that referenced this pull request Oct 17, 2025
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.

@artongeartonge 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.

I think we should rather change the check to check whether the share owner can create links. This would allow preventing access to a share if the share owner is prevented to create links after it was created.

@nfebe
nfebeforce-pushed the fix/public-share-group-exclusion-access branch from 7a9c04a to ea29e2fCompareNovember 13, 2025 10:46
@nfebe
nfebe requested a review from artongeNovember 13, 2025 10:48
@nfebe
nfebeforce-pushed the fix/public-share-group-exclusion-access branch from ea29e2f to e222c83CompareNovember 13, 2025 22:17
Comment threadlib/private/Share20/Manager.php
Comment threadlib/private/Share20/Manager.php
@juliusknorr

Copy link
Copy Markdown
Member

/backport to stable32

@juliusknorr

Copy link
Copy Markdown
Member

/backport to stable31

@juliusknorr

Copy link
Copy Markdown
Member

/backport to stable30

@nfebe
nfebeforce-pushed the fix/public-share-group-exclusion-access branch from e222c83 to ed0d841CompareNovember 25, 2025 11:38
@nfebe
nfebeforce-pushed the fix/public-share-group-exclusion-access branch from ed0d841 to 5aa8a64CompareNovember 25, 2025 11:40
@juliusknorr
juliusknorrforce-pushed the fix/public-share-group-exclusion-access branch from 5aa8a64 to ca7755fCompareNovember 27, 2025 07:53
Comment threadlib/public/Share/IManager.php Outdated
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.
We now check the exclusion for the share creator and not the viewer.
Signed-off-by: nfebe <fenn25.fn@gmail.com>
@nfebe
nfebeforce-pushed the fix/public-share-group-exclusion-access branch from ca7755f to 6bccaf7CompareDecember 2, 2025 08:45
@nfebe
nfebe merged commit 68b9108 into masterDec 2, 2025
268 of 290 checks passed
@nfebe
nfebe deleted the fix/public-share-group-exclusion-access branch December 2, 2025 14:42
@nextcloud-botnextcloud-bot mentioned this pull request Jan 6, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

4 participants

@nfebe@juliusknorr@artonge@provokateurin