diff options
-rw-r--r-- | lib/private/Share20/Manager.php | 9 | ||||
-rw-r--r-- | lib/public/Share/IManager.php | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 82e948344c1..9023e14fd2c 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -1764,6 +1764,15 @@ class Manager implements IManager { return $this->config->getAppValue('core', 'shareapi_allow_group_sharing', 'yes') === 'yes'; } + public function allowEnumeration(): bool { + return $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes'; + } + + public function limitEnumerationToGroups(): bool { + return $this->allowEnumeration() && + $this->config->getAppValue('core', 'shareapi_restrict_user_enumeration_to_group', 'no') === 'yes'; + } + /** * Copied from \OC_Util::isSharingDisabledForUser * diff --git a/lib/public/Share/IManager.php b/lib/public/Share/IManager.php index b6354be3978..820835365d9 100644 --- a/lib/public/Share/IManager.php +++ b/lib/public/Share/IManager.php @@ -369,6 +369,22 @@ interface IManager { public function allowGroupSharing(); /** + * Check if user enumeration is allowed + * + * @return bool + * @since 19.0.0 + */ + public function allowEnumeration(): bool; + + /** + * Check if user enumeration is limited to the users groups + * + * @return bool + * @since 19.0.0 + */ + public function limitEnumerationToGroups(): bool; + + /** * Check if sharing is disabled for the given user * * @param string $userId |