-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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 federated link sharing permissions #20726
Conversation
20b049e
to
109f614
Compare
109f614
to
d221e77
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does the job!
Needs a rebase and then time to get it in |
d221e77
to
fd7b0b1
Compare
/compile amend / |
fd7b0b1
to
6322ede
Compare
Conflicts |
6322ede
to
5d0ffce
Compare
/compile amend / |
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
5d0ffce
to
ff20da6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code makes sense 👍
Lots of test sfailures 😞 |
mmm Did I hit merge on the wrong PR... guess so... |
@@ -215,11 +216,20 @@ protected function formatShare(\OCP\Share\IShare $share, Node $recipientNode = n | |||
$result['expiration'] = $expiration->format('Y-m-d 00:00:00'); | |||
} | |||
|
|||
if ($share->getShareType() === Share::SHARE_TYPE_USER) { | |||
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember the discussion here but I guess I only now see the full impact. The permission needs to be persisted in the DB else the share conversion still doesn't happen. Because other part of the NC code don't use this they uyse the share object.
So either we do not care at all. ANd just check where we need to. Or we need to also make sure it is correct in the db.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this basically reverts what we tried to do in #19793
Let me prepare a fix
So, it of course means we don't store the SHARE permissions for link shares. We only add it on api GET.
It was mostly because of this
server/apps/files_sharing/lib/Controller/ShareAPIController.php
Lines 1002 to 1005 in d221e77
i don't really know what we should do for this. So instead of changing 2 years old code that looks super speficic, I rathered make sure we keep it consistent. Maybe it's wrong, please suggest any better way 👋
In any case, this is a bit odd because when changint the link share to something like READ, we now see in the response that they have the SHARE permission, despite not really being asked for, but I guess it's fine as it behave like an enforced setting?
Reference: #19793 (comment)
It might fix #20692