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

[stable29] fix(files_sharing): Respect permissions passed when creating link shares #50504

Merged
merged 3 commits into from
Feb 1, 2025

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jan 28, 2025

Backport of #50270

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot backportbot bot added this to the Nextcloud 29.0.12 milestone Jan 28, 2025
@susnux susnux force-pushed the backport/50270/stable29 branch from 6c3a328 to f600a03 Compare January 31, 2025 17:43
@susnux susnux marked this pull request as ready for review January 31, 2025 17:44
susnux and others added 3 commits January 31, 2025 18:46
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.

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux susnux force-pushed the backport/50270/stable29 branch from f600a03 to 3d50853 Compare January 31, 2025 17:46
} else {
// Use default permissions only for non-link shares to keep legacy behavior
if ($permissions === null) {
$permissions = (int)$this->config->getAppValue('core', 'shareapi_default_permissions', (string)Constants::PERMISSION_ALL);

Check notice

Code scanning / Psalm

DeprecatedMethod Note

The method OCP\IConfig::getAppValue has been marked as deprecated
@provokateurin provokateurin merged commit 547dc41 into stable29 Feb 1, 2025
181 checks passed
@provokateurin provokateurin deleted the backport/50270/stable29 branch February 1, 2025 10:19
@Altahrim Altahrim mentioned this pull request Feb 5, 2025
5 tasks
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.

2 participants