-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conversation
/backport to stable30 |
8476ff3
to
8283538
Compare
/backport to stable31 |
/backport to stable29 |
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 found it a bit hard to follow all the changes in the first commit, maybe you can split such big refactorings into multiple atomic commits that are easier to review.
Other than that this LGTM, just one minor comment.
if ($permissions === null) { | ||
if ($shareType === IShare::TYPE_LINK | ||
|| $shareType === IShare::TYPE_EMAIL) { | ||
assert($this->userId !== null); |
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.
Should we really use assertions?
In theory we know that the userid is not null, but we should still check.
Assertions can be disabled, so idk if it's the best to check this way.
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.
we already do so would consider this a living standard. But yes could improve - but again this would mean our middleware is broken 🙈
b00f992
to
1b560ea
Compare
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 <[email protected]> Co-authored-by: Côme Chilliet <[email protected]> Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
Signed-off-by: Ferdinand Thiessen <[email protected]>
1b560ea
to
0baab8f
Compare
/backport to stable28 |
/backport to stable27 |
/backport to stable26 |
Summary
Given:
Problem:
Solution:
Checklist