Skip to content
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

Skip initial permission check on setName method for shared mounts #38794

Merged
merged 6 commits into from
Jun 1, 2021

Conversation

JammingBen
Copy link
Contributor

@JammingBen JammingBen commented May 31, 2021

Description

Because renaming a mount should always be possible (see https://github.com/owncloud/enterprise/issues/4582#issuecomment-851328502).

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@JammingBen
Copy link
Contributor Author

It seems that the check can be removed safely. This makes it possible to always rename a share regardless of its permissions. Not a 100% sure though, any opinions or thoughts @mrow4a ?

Another thing to mention: we still have the same issue with mounted storages. The UI shows the "rename"-action for a storage, but renaming results in an error. @jvillafanez You've dealt with a similar issue lately if I remember correctly? Something related to WND?

@jvillafanez
Copy link
Member

Yes. #38709 is just for SMB. WND has similar changes too. I don't know if we want to make similar changes for all the storages.

@jvillafanez
Copy link
Member

Could we check instead if the node refers to a shared mount? Something like "if node is not a shared mount and not writable, then throw forbidden exception" It seems more reasonable than just removing the permission check.

@JammingBen
Copy link
Contributor Author

@jvillafanez

I don't know if we want to make similar changes for all the storages.

Depends on the solution I would say. According to Patrick, a mount point should always be allowed to be renamed. Your fix is heading in a different direction if I understood correctly, I assume because it was an easy fix for the problem? So that would be something for the future.

Could we check instead if the node refers to a shared mount? Something like "if node is not a shared mount and not writable, then throw forbidden exception" It seems more reasonable than just removing the permission check.

Good point, I updated the PR.

@phil-davis How do we handle the acceptance test in https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToRoot/moveReceivedShareOc10Issue30325.feature? Do we adjust it, or better remove entirely?

@JammingBen JammingBen changed the title Remove initial permission check on setName method Skip initial permission check on setName method for shared mounts May 31, 2021
@phil-davis
Copy link
Contributor

How do we handle the acceptance test in https://github.com/owncloud/core/blob/master/tests/acceptance/features/apiShareManagementToRoot/moveReceivedShareOc10Issue30325.feature? Do we adjust it, or better remove entirely?

Remove it, and search for issue-30325 tags. Remove the skipOnOcV10 tags from the "good" scenarios. Those should now pass.

The same sort of thing is here: https://github.com/owncloud/core/blob/master/tests/acceptance/features/webUIRenameFolders/renameFoldersOc10Issue30325.feature

@phil-davis phil-davis self-requested a review May 31, 2021 14:42
@JammingBen JammingBen marked this pull request as ready for review June 1, 2021 06:15
@owncloud owncloud deleted a comment from update-docs bot Jun 1, 2021
Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

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

Code and test changes LGTM

changelog/unreleased/38794 Show resolved Hide resolved
Copy link
Member

@jvillafanez jvillafanez left a comment

Choose a reason for hiding this comment

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

Little detail. Code looks good anyway.

apps/dav/lib/Connector/Sabre/Node.php Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Jun 1, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@JammingBen JammingBen merged commit bcfdf45 into master Jun 1, 2021
@delete-merged-branch delete-merged-branch bot deleted the remove-permission-check-on-setName branch June 1, 2021 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename option is visible, even though user only has share permissions
4 participants