Skip to content

Sharing: Use maximum allowed permissions for new share - #6352

Merged
ckamm merged 1 commit into
2.4from
permissions-new-share
Feb 15, 2018
Merged

ckamm merged 1 commit into
2.4from
permissions-new-share

Conversation

@ckamm

@ckamm ckamm commented Feb 9, 2018

Copy link
Copy Markdown
Contributor

The client already computed the valid permissions, there was just a typo
that meant we didn't end up using them.

See #6346

The client already computed the valid permissions, there was just a typo
that meant we didn't end up using them.
@ckamm ckamm added this to the 2.4.1 milestone Feb 9, 2018
@ckamm ckamm self-assigned this Feb 9, 2018
@ckamm
ckamm requested a review from ogoffart February 9, 2018 13:45
Comment thread src/gui/sharemanager.cpp
if (validPermissions == SharePermissionDefault) {
validPermissions = existingPermissions;
}
if (existingPermissions != SharePermissionDefault) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, existingPermissions can be SharePermissionDefault, so the code is correct.
But the else was not wrong. Was there a reason behind this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Comment thread src/gui/sharemanager.cpp
if (validPermissions == SharePermissionDefault) {
validPermissions = existingPermissions;
}
if (existingPermissions != SharePermissionDefault) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok, existingPermissions can be SharePermissionDefault, so the code is correct.
But the else was not wrong. Was there a reason behind this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants