Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(files_sharing): Respect permissions passed when creating link shares #50270

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

susnux
Copy link
Contributor

@susnux susnux commented Jan 20, 2025

Summary

Given:

  • User creates a link or email share with permissions=4 (create only = file drop).

Problem:

  • Currently the permissions are automatically extended to permissions = 5 (READ + CREATE).
  • Workaround was to create the share and directly update it.

Solution:

  • Respect what the user is requesting, create a file drop share.

Checklist

@susnux susnux added this to the Nextcloud 31 milestone Jan 20, 2025
@susnux
Copy link
Contributor Author

susnux commented Jan 20, 2025

/backport to stable30

@Altahrim Altahrim mentioned this pull request Jan 21, 2025
@susnux susnux requested a review from come-nc January 21, 2025 08:26
: Constants::PERMISSION_READ;
}

// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones

This is a feature request and should not be in the code in my opinion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its not from me but just moved, see in "delete" side of the GIT diff line 721.

apps/files_sharing/lib/Controller/ShareAPIController.php Outdated Show resolved Hide resolved
@susnux susnux force-pushed the fix/share-api-create--permissions branch from aa86d75 to ad555f6 Compare January 21, 2025 11:00
Given:
User creates a link or email share with permissions=4 (create only = file drop).

Problem:
Currently the permissions are automatically extended to permissions = 5
(READ + CREATE). Work around was to create the share and directly update
it.

Solution:
Respect what the user is requesting, create a file drop share.

Signed-off-by: Ferdinand Thiessen <[email protected]>
@susnux susnux force-pushed the fix/share-api-create--permissions branch from ad555f6 to 2914318 Compare January 21, 2025 12:20
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.

Create Share API not honoring "permissions" parameter
2 participants