diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2021-03-29 18:15:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-29 18:15:58 +0300 |
commit | b10748ed7b8c3f74ba0b977cc2d144ad1928a865 (patch) | |
tree | 28a04caaeced9fbbeb25c77e3669a451c4461157 /lib | |
parent | 4f80f44ccc3e94423ef8f42ceb47d5bc537f20a7 (diff) | |
parent | b58dd9ee6018a9809f6359c1d355ce7f95392ac0 (diff) |
Merge pull request #4785 from nextcloud/respect-allow-group-sharing-setting
Respect allow/disallow group sharing setting in group service
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/Group/NextcloudGroupService.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Service/Group/NextcloudGroupService.php b/lib/Service/Group/NextcloudGroupService.php index 2c3dd1a72..ca3dce3cd 100644 --- a/lib/Service/Group/NextcloudGroupService.php +++ b/lib/Service/Group/NextcloudGroupService.php @@ -4,6 +4,7 @@ declare(strict_types=1); /** * @author Matthias Rella <mrella@pisys.eu> + * @author Thomas Citharel <nextcloud@tcit.fr> * * Mail * @@ -23,6 +24,7 @@ declare(strict_types=1); namespace OCA\Mail\Service\Group; +use OCP\IConfig; use OCP\IGroupManager; use OCA\Mail\Exception\ServiceException; @@ -36,14 +38,20 @@ class NextcloudGroupService implements IGroupService { private $groupManager; /** + * @var IConfig + */ + private $config; + + /** * Group's namespace * * @var string */ private $namespace = "Nextcloud"; - public function __construct(IGroupManager $groupManager) { + public function __construct(IGroupManager $groupManager, IConfig $config) { $this->groupManager = $groupManager; + $this->config = $config; } public function getNamespace(): string { @@ -51,6 +59,9 @@ class NextcloudGroupService implements IGroupService { } public function search(string $term): array { + if ($this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') !== 'yes') { + return []; + } $groups = $this->groupManager->search($term); return array_map( |