The recipient of internal share should not increase permission#35447
The recipient of internal share should not increase permission#35447
Conversation
53468b6 to
ea751b9
Compare
Codecov Report
@@ Coverage Diff @@
## master #35447 +/- ##
============================================
+ Coverage 65.66% 65.66% +<.01%
- Complexity 18666 18670 +4
============================================
Files 1221 1221
Lines 70597 70602 +5
Branches 1288 1288
============================================
+ Hits 46358 46363 +5
Misses 23862 23862
Partials 377 377
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #35447 +/- ##
============================================
+ Coverage 65.68% 65.68% +<.01%
- Complexity 18729 18735 +6
============================================
Files 1221 1221
Lines 70779 70793 +14
Branches 1288 1288
============================================
+ Hits 46490 46503 +13
- Misses 23912 23913 +1
Partials 377 377
Continue to review full report at Codecov.
|
ea751b9 to
aee99b6
Compare
| $share->getNode()->unlock(ILockingProvider::LOCK_SHARED); | ||
| return new Result(null, 400, $this->l->t('Wrong or no update parameter given')); | ||
| } else { | ||
| if ($share->getShareType() === Share::SHARE_TYPE_USER) { |
There was a problem hiding this comment.
Shouldn't this be applied to groups as well? I think what you're trying to do here is to prevent the increase of permissions by anyone that isn't the owner of the share, but this should be applied to any kind of share I think.
Btw, the error message should be changed because anyone can reduce the permissions
|
|
||
| if ($share->getPermissions() & ~$maxPermissions) { | ||
| if (($share->getPermissions() & ~$maxPermissions) && | ||
| //A condition where the user belongs to the same group which requests this update should be ignored |
There was a problem hiding this comment.
I think that noone other than the owner should be able to increase the permissions regardless of the share, so the additional condition should be removed (?)
aee99b6 to
b9f1d41
Compare
jvillafanez
left a comment
There was a problem hiding this comment.
maybe the canIncreasePermission might return null if we can't get the user from the session in order to distinguish cases, but since it's a private function it doesn't really matters.
The recipient of internal share, should not be able to increase the permission. Signed-off-by: Sujith H <sharidasan@owncloud.com>
b9f1d41 to
663e99a
Compare
|
Backport PR: #35475 |
The recipient of internal share, should not be able
to increase the permission.
Signed-off-by: Sujith H sharidasan@owncloud.com
Description
When an internal/regular share is created by say
user1touser2, theuser2should not be allowed to increase the permissions granted byuser1. The UI prevents it. But by using ocs api, its possible to increase the permision. This pr addresses the issue.Related Issue
Motivation and Context
The user who is not the owner of the share shouldn't be allowed to increase the permission of the share.
How Has This Been Tested?
user1,user2anduser3user1create foldertestFolder/subFolderuser1sharetestFoldertouser2with permissioncan shareand uncheckcan edit( i.e, readonly )user2try to resharetestFolder/subFoldertouser3can shareand readonly permission byuser1touser2, anduser2reshares touser3, when the command is executed for the share ofuser2:Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: