diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-06-01 12:07:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-01 12:07:29 +0200 |
commit | b29c3aa03f1f5b95b12b51e4f95148f2f01b59d3 (patch) | |
tree | 29ab71a2c5a7723fddd34ee2e6ec17f7245e11d9 /apps/dav/lib | |
parent | 68a02bbef8dfe47dd4c54023f02fde4e91e212d9 (diff) | |
parent | 1c0d975654f71a1ac6a3d30ece915fa6e55397da (diff) | |
download | nextcloud-server-b29c3aa03f1f5b95b12b51e4f95148f2f01b59d3.tar.gz nextcloud-server-b29c3aa03f1f5b95b12b51e4f95148f2f01b59d3.zip |
Merge pull request #25658 from nextcloud/dav-respect-disallow-sharing-with-groups
Dav respect disallow sharing with groups
Diffstat (limited to 'apps/dav/lib')
-rw-r--r-- | apps/dav/lib/DAV/GroupPrincipalBackend.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php index ae66d85f4ca..1b96f2ee8ba 100644 --- a/apps/dav/lib/DAV/GroupPrincipalBackend.php +++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php @@ -196,9 +196,8 @@ class GroupPrincipalBackend implements BackendInterface { if ($prefixPath !== self::PRINCIPAL_PREFIX) { return []; } - // If sharing is disabled, return the empty array - $shareAPIEnabled = $this->shareManager->shareApiEnabled(); - if (!$shareAPIEnabled) { + // If sharing or group sharing is disabled, return the empty array + if (!$this->groupSharingEnabled()) { return []; } @@ -273,8 +272,7 @@ class GroupPrincipalBackend implements BackendInterface { */ public function findByUri($uri, $principalPrefix) { // If sharing is disabled, return the empty array - $shareAPIEnabled = $this->shareManager->shareApiEnabled(); - if (!$shareAPIEnabled) { + if (!$this->groupSharingEnabled()) { return null; } @@ -340,4 +338,11 @@ class GroupPrincipalBackend implements BackendInterface { return $principal; } + + /** + * @return bool + */ + private function groupSharingEnabled(): bool { + return $this->shareManager->shareApiEnabled() && $this->shareManager->allowGroupSharing(); + } } |