Skip to content

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

Merged
JammingBen merged 6 commits into
masterfrom
remove-permission-check-on-setName
Jun 1, 2021
Merged

Skip initial permission check on setName method for shared mounts#38794
JammingBen merged 6 commits into
masterfrom
remove-permission-check-on-setName

Conversation

@JammingBen

@JammingBen JammingBen commented May 31, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 May 31, 2021
@phil-davis

Copy link
Copy Markdown
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

Comment thread tests/acceptance/features/webUIRenameFolders/renameFolders.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

@phil-davis phil-davis left a comment

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.

Code and test changes LGTM

Comment thread changelog/unreleased/38794

@jvillafanez jvillafanez left a comment

Copy link
Copy Markdown
Member

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.

Comment thread apps/dav/lib/Connector/Sabre/Node.php
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2021

Copy link
Copy Markdown

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

4 participants