Skip to content

Conversation

@nfebe
Copy link
Contributor

@nfebe nfebe commented Sep 22, 2025

When creating public links from federated shares, users should be able to set the 'Hide download' option independently as long as they are more restrictive than the original share permissions.

Previously, the checkInheritedAttributes method was ignoring user preferences and always overriding the hideDownload setting based solely on inherited permissions, preventing users from disabling downloads even when the parent share allowed them.

This fix implements some sort of inheritance logic:

  • Users can only be MORE restrictive than parent shares, never LESS restrictive
  • If parent hides downloads -> child MUST hide downloads (enforced)
  • If parent allows downloads -> child can CHOOSE to hide or allow downloads
  • If parent forbids downloads entirely -> child cannot enable downloads

@nfebe nfebe requested a review from a team as a code owner September 22, 2025 08:42
@nfebe nfebe requested review from come-nc, icewind1991 and salmart-dev and removed request for a team September 22, 2025 08:42
@nfebe nfebe force-pushed the fix/federated-share-hide-download branch from a32def2 to 6c9b2e3 Compare September 22, 2025 08:43
@marcelklehr
Copy link
Member

Thank you for working on this! I think it would be good if the possibilities were also somehow visible in the UI. Is this the case with this already?

@nfebe
Copy link
Contributor Author

nfebe commented Sep 22, 2025

Thank you for working on this! I think it would be good if the possibilities were also somehow visible in the UI. Is this the case with this already?

This changes should solve the issue of the toggle not taking effect in the UI.

@nfebe nfebe requested a review from ArtificialOwl September 23, 2025 09:14
@susnux susnux added this to the Nextcloud 33 milestone Sep 24, 2025
@artonge artonge changed the title fix(sharing): Allow reasonable control 4 'Hide download' on fed shares fix(sharing): Allow reasonable control for 'Hide download' on fed shares Sep 24, 2025
@nfebe nfebe force-pushed the fix/federated-share-hide-download branch from 5c51164 to 8ed4c1a Compare October 9, 2025 07:47
@nfebe nfebe requested a review from artonge October 9, 2025 07:47
Copy link
Contributor

@artonge artonge left a comment

Choose a reason for hiding this comment

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

Let's have some tests to prevent any regressions

@DaphneMuller
Copy link

@nfebe is there any chance this pr can be merged soon?

@nfebe nfebe force-pushed the fix/federated-share-hide-download branch 3 times, most recently from b50837d to 14298fe Compare October 20, 2025 14:53
@nfebe nfebe requested a review from artonge October 20, 2025 14:54
@nfebe
Copy link
Contributor Author

nfebe commented Oct 20, 2025

@nfebe is there any chance this pr can be merged soon?

Updated it and added some tests. (Sorry I have had some laptop downtime recently)

@nfebe nfebe force-pushed the fix/federated-share-hide-download branch from 14298fe to 02de83d Compare October 20, 2025 16:25
@nfebe nfebe force-pushed the fix/federated-share-hide-download branch from 02de83d to 32f92af Compare October 21, 2025 16:08
@nfebe nfebe enabled auto-merge October 21, 2025 16:09
@nfebe nfebe force-pushed the fix/federated-share-hide-download branch from 32f92af to 712b0a3 Compare October 21, 2025 23:18
@DaphneMuller
Copy link

@nfebe What is needed to merge this PR?

When creating public links from federated shares, users should be able to set
the 'Hide download' option independently as long as they are more restrictive
than the original share permissions.

Previously, the `checkInheritedAttributes` method was ignoring user preferences
and always overriding the hideDownload setting based solely on inherited
permissions, preventing users from disabling downloads even when the parent
share allowed them.

This fix implements some sort of inheritance logic:
- Users can only be MORE restrictive than parent shares, never LESS restrictive
- If parent hides downloads -> child MUST hide downloads (enforced)
- If parent allows downloads -> child can CHOOSE to hide or allow downloads
- If parent forbids downloads entirely -> child cannot enable downloads

Signed-off-by: nfebe <[email protected]>
@nfebe nfebe force-pushed the fix/federated-share-hide-download branch from 712b0a3 to 6401689 Compare October 23, 2025 15:09
@nfebe nfebe merged commit ed1647b into master Oct 23, 2025
222 of 230 checks passed
@nfebe nfebe deleted the fix/federated-share-hide-download branch October 23, 2025 17:37
@DaphneMuller
Copy link

Thank you! 🎉

@maximelehericy
Copy link

@nfebe any chances to see that backported in 32 or not at all ?

@nfebe
Copy link
Contributor Author

nfebe commented Nov 4, 2025

/backport to stable32

@nfebe
Copy link
Contributor Author

nfebe commented Nov 4, 2025

/backport to stable31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants