Repository navigation
Sharing: Use maximum allowed permissions for new share - #6352
Conversation
The client already computed the valid permissions, there was just a typo that meant we didn't end up using them.
| if (validPermissions == SharePermissionDefault) { | ||
| validPermissions = existingPermissions; | ||
| } | ||
| if (existingPermissions != SharePermissionDefault) { |
There was a problem hiding this comment.
Is that condition not always true? (If I understand correctly, SharePermissionDefault is just a placeholder which cannot appear in the actual pemissions)
And why not keep the else as before? since existingPermissions & existingPermissions == existingPermissions
There was a problem hiding this comment.
ah ok, existingPermissions can be SharePermissionDefault, so the code is correct.
But the else was not wrong. Was there a reason behind this change?
There was a problem hiding this comment.
@ogoffart Since the conditions are logically separate (decide what we want, then limit to what is possible) I thought it was easier to understand without the else even though the second can only be true when the first isn't.
| if (validPermissions == SharePermissionDefault) { | ||
| validPermissions = existingPermissions; | ||
| } | ||
| if (existingPermissions != SharePermissionDefault) { |
There was a problem hiding this comment.
ah ok, existingPermissions can be SharePermissionDefault, so the code is correct.
But the else was not wrong. Was there a reason behind this change?
The client already computed the valid permissions, there was just a typo
that meant we didn't end up using them.
See #6346