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

Nested sharing could only lower the access rights #19012

Open
Irillit opened this issue Jan 20, 2020 · 1 comment
Open

Nested sharing could only lower the access rights #19012

Irillit opened this issue Jan 20, 2020 · 1 comment
Labels
1. to develop Accepted and waiting to be taken care of enhancement feature: sharing

Comments

@Irillit
Copy link

Irillit commented Jan 20, 2020

Mostly I wonder is it a bug or feature? Is there any special reason Nextcloud work like that? And are there any changes in next releases?

Steps to reproduce

  1. Create folder1 and test.txt in it;
  2. Give some user read-only permissions to folder;
  3. Give the same user write prmissions to test.txt;

Expected behaviour

User should be able to write into file. The closest sharing option should be selected.

Actual behaviour

User has read-only access to file.

Cause

In Cache.php of files_sharing application there is an entry:

if (isset($entry['permissions'])) {
    $entry['permissions'] &= $sharePermissions;
} else {
    $entry['permissions'] = $sharePermissions;
}

If you change AND (&=) to OR (|=), you'll not be able to forbid user something inside the shared folder.
Is there any reason why we can't use $entry['permissions'] to the file?

Nextcloud version: 16

@Irillit Irillit added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 20, 2020
@szaimen
Copy link
Contributor

szaimen commented Jun 7, 2021

I could reproduce this on NC21.0.2.
So most likely we should hide edit permissions for this user when sharing a file inside a folder with him/her.

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of enhancement and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of enhancement feature: sharing
Projects
None yet
Development

No branches or pull requests

4 participants