X Tutup
Skip to content

Prevent user to see directory content if share is a file drop#38691

Merged
AlexAndBear merged 1 commit intomasterfrom
issues/enterprise/4540
May 5, 2021
Merged

Prevent user to see directory content if share is a file drop#38691
AlexAndBear merged 1 commit intomasterfrom
issues/enterprise/4540

Conversation

@AlexAndBear
Copy link

@AlexAndBear AlexAndBear commented May 4, 2021

Description

Requesting file drop share with the deprecated shareinfo API, exposed
information about the content of the file drop share.
We will now deliver empty content on the children entry.

Related Issue

Motivation and Context

How Has This Been Tested?

  • test environment:
  • test case 1:
  • test case 2:
  • ...

Screenshots (if appropriate):

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

@AlexAndBear AlexAndBear force-pushed the issues/enterprise/4540 branch from 874d47e to 0f8054c Compare May 4, 2021 12:01
@owncloud owncloud deleted a comment from update-docs bot May 4, 2021
@AlexAndBear AlexAndBear marked this pull request as ready for review May 4, 2021 12:01
@sonarqubecloud
Copy link

sonarqubecloud bot commented May 4, 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

@AlexAndBear AlexAndBear requested a review from mrow4a May 5, 2021 14:10
@AlexAndBear AlexAndBear merged commit 5ce5494 into master May 5, 2021
@delete-merged-branch delete-merged-branch bot deleted the issues/enterprise/4540 branch May 5, 2021 18:32
*/
function getChildInfo($dir, $view, $sharePermissions) {
// Prevent user to see directory content if share is a file drop
if ($sharePermissions === \OCP\Constants::PERMISSION_CREATE) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Personally I would have done

if ($sharePermissions & \OCP\Constants::PERMISSION_READ !== \OCP\Constants::PERMISSIONS_READ) {

to check if the read permission bit is set.

This would be more flexible.

Copy link
Author

Choose a reason for hiding this comment

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

will open a PR

Copy link
Author

Choose a reason for hiding this comment

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

See #38724

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.

4 participants

X Tutup