]> source.dussan.org Git - nextcloud-server.git/commitdiff
Expose enumeration config though share manager
authorJulius Härtl <jus@bitgrid.net>
Thu, 20 Feb 2020 17:51:35 +0000 (18:51 +0100)
committerJulius Härtl <jus@bitgrid.net>
Fri, 20 Mar 2020 09:43:56 +0000 (10:43 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/Share20/Manager.php
lib/public/Share/IManager.php

index 82e948344c1004e1012d7c0dd2e0e81d0c1c09ab..9023e14fd2c497babf7cae4c88582ad7475c6fc8 100644 (file)
@@ -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
         *
index b6354be39782882e914ebcc5216c498eed1357f1..820835365d94ec7ca30cc8d825736ee1ade3d9b7 100644 (file)
@@ -368,6 +368,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
         *