-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Exclude users from sharing if they are a member of any excluded group #31490
Conversation
lib/private/Share20/Manager.php
Outdated
return true; | ||
} | ||
$matchingGroups = array_intersect($usersGroups, $excludedGroups); | ||
if(!empty($matchingGroups)) { |
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.
s/if(/if (/
Pretty sure php-cs-fixer
wants a space between if
and (
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.
Agreed - still need to cache this in my brain-memory
lib/private/Share20/Manager.php
Outdated
} | ||
$matchingGroups = array_intersect($usersGroups, $excludedGroups); | ||
if(!empty($matchingGroups)) { | ||
// If the user is a member of any of the exlucded groups they cannot use sharing |
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.
s/exlucded/excluded/
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.
👍
@paurakhsharma as you happen to be working on expanding sharing API acceptance tests, it would be good to cover scenarios for this kind of thing. |
f69e145
to
4353cb7
Compare
Codecov Report
@@ Coverage Diff @@
## master #31490 +/- ##
============================================
- Coverage 62.83% 62.83% -0.01%
+ Complexity 18371 18370 -1
============================================
Files 1151 1151
Lines 69058 69057 -1
Branches 1260 1260
============================================
- Hits 43395 43394 -1
Misses 25294 25294
Partials 369 369
Continue to review full report at Codecov.
|
4353cb7
to
4f0eaf5
Compare
Fixes #16346 |
Ok I will look into it. |
needs @pmaier1 approval for this change of behavior we can still carry on and write acceptance tests as we need them anyway for groups exclusion |
Ok, so this was approved already. Need to carry on with acceptance tests and code review |
I need to fix the tests |
Estimate to completion: 1md (dev + QA tests) @tomneedham @patrickjahns |
@paurakhsharma will look on Monday and first make some acceptance tests in master that check the the "easy" behavior when the user is in just the "excluded from sharing" group. Then add a commit to this PR with tests for the case when the user is in the "excluded from sharing" group and also in other group(s). |
@tomneedham code change looks good but PR is missing a unit test. Please add it! |
4f0eaf5
to
a1827de
Compare
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.
👍
@phil-davis acceptance tests to be added separately or on this PR ?
If we can resolve #31580 so I can get these "exclude groups" settings easily in the capabilities (which is the way acceptance tests handle most of these sort of file-sharing options) then I can do the acceptance tests "in no time". |
I'll merge this, please separate PR for acceptance tests |
please backport |
Issue #31696 for acceptance tests, so we do not forget. |
@tomneedham backporting? |
Question, where can you define that a group is an excluded group for sharing? |
Settings, Admin, Sharing. Check box "Exclude groups from sharing". Then you see a box to input group names. |
got it, thanks a lot 😄 |
See #31819 for another place where this logic lives. |
issue raised here #31820, need to look into steps to confirm this |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
Sharing is disabled, if a user is a member of any of the excluded groups.
Related Issue
https://github.com/owncloud/enterprise/issues/2508
Motivation and Context
The existing feature is redundant if the user gets added to another group.
How Has This Been Tested?
Manually.
Types of changes
Checklist: