]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add integration tests for default share permissions 24042/head
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Tue, 10 Nov 2020 21:17:04 +0000 (22:17 +0100)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Wed, 11 Nov 2020 01:31:25 +0000 (02:31 +0100)
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
build/integration/features/bootstrap/SharingContext.php
build/integration/sharing_features/sharing-v1.feature

index ab480dec4a306c918390ff7857d8356a388542c4..447b8f1c0246677b823adffede28078e90c1f6cc 100644 (file)
@@ -37,6 +37,7 @@ class SharingContext implements Context, SnippetAcceptingContext {
        use CommandLine;
 
        protected function resetAppConfigs() {
+               $this->modifyServerConfig('core', 'shareapi_default_permissions', '31');
                $this->modifyServerConfig('sharebymail', 'enforcePasswordProtection', 'no');
        }
 }
index 764cd857a3ec5b1bc6799e3c75c3e74f4aba50c5..38eb2d8a812cc6fb33add913ff888dd0978f3c90 100644 (file)
@@ -357,6 +357,40 @@ Feature: sharing
       | url | AN_URL |
       | mimetype | httpd/unix-directory |
 
+  Scenario: Creating a new share of a file with default permissions
+    Given user "user0" exists
+    And user "user1" exists
+    And As an "user0"
+    And parameter "shareapi_default_permissions" of app "core" is set to "7"
+    When creating a share with
+      | path | welcome.txt |
+      | shareWith | user1 |
+      | shareType | 0 |
+    And the OCS status code should be "100"
+    And the HTTP status code should be "200"
+    And Getting info of last share
+    Then the OCS status code should be "100"
+    And the HTTP status code should be "200"
+    And Share fields of last share match with
+      | permissions | 3 |
+
+  Scenario: Creating a new share of a folder with default permissions
+    Given user "user0" exists
+    And user "user1" exists
+    And As an "user0"
+    And parameter "shareapi_default_permissions" of app "core" is set to "7"
+    When creating a share with
+      | path | FOLDER |
+      | shareWith | user1 |
+      | shareType | 0 |
+    And the OCS status code should be "100"
+    And the HTTP status code should be "200"
+    And Getting info of last share
+    Then the OCS status code should be "100"
+    And the HTTP status code should be "200"
+    And Share fields of last share match with
+      | permissions | 7 |
+
   Scenario: getting all shares of a user using that user
     Given user "user0" exists
     And user "user1" exists