[stable17] Fix federated link sharing permissions #21587
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #20726
Follow up to #21110
If a link share has read permissions it may have too share permissions (depending on whether federated shares are allowed or not). Therefore the share permission needs to be ignored when checking the permissions to determine the public upload status.
Due to this the radio buttons for Read only and Allow upload and editing in the share menu of a folder shared by link will not be checked (except if they are selected again due to how the update and the rendering of the menu works, but after reloading the page they will be gone). File drop (upload only), on the other hand, is properly checked, as in that case the share does not have read permissions and thus the share permission is not set.
How to test
Result with this pull request
The radio button for Read only is checked.
Result without this pull request
No radio button is checked.