diff options
author | Thomas Citharel <tcit@tcit.fr> | 2021-02-15 16:12:33 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2021-05-26 11:19:59 +0200 |
commit | 1c0d975654f71a1ac6a3d30ece915fa6e55397da (patch) | |
tree | 9499160ad9d01b7ee2e28b711e4e1cf6a5493586 /apps/dav/lib | |
parent | e4b5645883d89ee3aca4105c1bde6ae4939f927c (diff) | |
download | nextcloud-server-1c0d975654f71a1ac6a3d30ece915fa6e55397da.tar.gz nextcloud-server-1c0d975654f71a1ac6a3d30ece915fa6e55397da.zip |
Make dav respect disallowing sharing with groups
Closes #25390
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
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(); + } } |