-
Notifications
You must be signed in to change notification settings - Fork 121
fix(Wopi): fall back to super share if share token is not available #4712
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
base: main
Are you sure you want to change the base?
Conversation
89ef31c
to
ea2be66
Compare
Only now I see that you are doing the almost same in other places, actually, but with SharedStorage instead of SharedMount. Do you want me to switch? |
Shouldn't make much of a difference, right? At least I cannot see any obvious one. I'd be fine either way but prefer consistency |
No difference, but on the same line with consistency. I'll update then. |
Rebase should have passing CI then as well |
ea2be66
to
d95f68c
Compare
On internal shares the controller is called without the share token. But necessary information, like share attributes, might be necessary to know and are available from the super share of the SharedStorage in that case. For this approach was used elsewhere, too, some repetitive code was consolidated in the Helper class. Signed-off-by: Arthur Schiwon <[email protected]>
d95f68c
to
1caa4f6
Compare
Also consolidated the handling of getting the share a bit across the occurrences. |
Cypress still keeps failing though. Is that what should have been fixed? |
Summary
On internal shares the controller is called without the share token. But necessary information, like share attributes, might be necessary to know and are available from the super share of the SharedMount in that case.
This can be testes as following:
It is expected that the document is opened with the watermark, but it does not. This is because we do not store (for we do not know) the share token of the document in
DocumentController::token()
. Hence we try now in the WopiController whether the share token is present and otherwise fall back to the super share.The super share combines any relevant present share. While some field stay empty (shareWith, shareToken, as they cannot be combined) the share attributes are. So if there would be another share of this document with the user, that does have download permissions, then the watermarking would not happen, as expected.
Checklist