Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/dav/lib/DAV/GroupPrincipalBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function searchPrincipals($prefixPath, array $searchProperties, $test = '
}
// If sharing is disabled, return the empty array
$shareAPIEnabled = $this->shareManager->shareApiEnabled();
if (!$shareAPIEnabled) {
if (!$shareAPIEnabled || !$this->shareManager->allowGroupSharing()) {
return [];
}

Expand Down Expand Up @@ -274,7 +274,7 @@ public function searchPrincipals($prefixPath, array $searchProperties, $test = '
public function findByUri($uri, $principalPrefix) {
// If sharing is disabled, return the empty array
$shareAPIEnabled = $this->shareManager->shareApiEnabled();
if (!$shareAPIEnabled) {
if (!$shareAPIEnabled || !$this->shareManager->allowGroupSharing()) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ public function search(string $search = '', string $itemType = null, int $page =
$shareTypes[] = IShare::TYPE_DECK;
}
} else {
$shareTypes[] = IShare::TYPE_GROUP;
if ($this->shareManager->allowGroupSharing()) {
$shareTypes[] = IShare::TYPE_GROUP;
}
$shareTypes[] = IShare::TYPE_EMAIL;
}

Expand Down
11 changes: 11 additions & 0 deletions lib/private/Collaboration/Collaborators/GroupPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@
use OCP\Share\IShare;

class GroupPlugin implements ISearchPlugin {
/** @var bool */
protected $shareeEnumeration;
/** @var bool */
protected $shareWithGroupOnly;
/** @var bool */
protected $shareeEnumerationInGroupOnly;
/** @var bool */
protected $groupSharingDisabled;

/** @var IGroupManager */
private $groupManager;
Expand All @@ -56,9 +62,14 @@ public function __construct(IConfig $config, IGroupManager $groupManager, IUserS
$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
$this->shareeEnumerationInGroupOnly = $this->shareeEnumeration && $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes';
$this->groupSharingDisabled = $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'no';
}

public function search($search, $limit, $offset, ISearchResult $searchResult) {
if ($this->groupSharingDisabled) {
return false;
}

$hasMoreResults = false;
$result = ['wide' => [], 'exact' => []];

Expand Down