fix(files_sharing): Respect permissions passed when creating link shares#50270
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 |
provokateurin
left a comment
There was a problem hiding this comment.
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.
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.
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