-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix permissions of mountpoints - take 2 #4685
Conversation
This reverts commit 70a0e9c. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
A moveable mount point (What a SharedStorage is) always has DELETE + UPDATE permissions. Since you can either delete (unshare) or update (rename) it. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@rullzer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @icewind1991, @schiessle and @LukasReschke to be potential reviewers. |
Mmmm the integration tests are not happy... lets see why |
Ah go it... |
$data['permissions'] |= \OCP\Constants::PERMISSION_DELETE; | ||
if ($internalPath === '') { | ||
if ($mount instanceof MoveableMount) { | ||
$data['permissions'] = $data['permissions'] | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@icewind1991 because you added the PERMISSION_UPDATE here it fails for shared files.
- user0 has
foo.txt
- user0 shares
foo.txt
to user1 with READ+SHARE permissions - user1 shares
foo.txt
to user2 with READ+SHARE+UPDATE permissions
This now works because well the mountpoint gets update permissions.
@@ -210,7 +210,7 @@ public function testGetPermissions() { | |||
// the read permissions (1) | |||
// the delete permission (8), to enable unshare | |||
$rootInfo = \OC\Files\Filesystem::getFileInfo($this->folder); | |||
$this->assertSame(9, $rootInfo->getPermissions()); | |||
$this->assertSame(\OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_DELETE | \OCP\Constants::PERMISSION_UPDATE, $rootInfo->getPermissions()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then also update the comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: Robin Appelman <robin@icewind.nl>
Codecov Report
@@ Coverage Diff @@
## master #4685 +/- ##
============================================
+ Coverage 54.28% 54.28% +<.01%
Complexity 22098 22098
============================================
Files 1361 1361
Lines 84710 84712 +2
Branches 1324 1324
============================================
+ Hits 45982 45984 +2
Misses 38728 38728
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👍
Damn ... I have overseen this failure:
@rullzer could you have a look? |
Looks like an actual bug :/ |
Yeah please revert. As we need to fix that properly our users can increase shared file permissions |
Done. |
#4623 + fix for the test.