From 3af171d634143f2bbe11e4223c432b08405a8605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Tue, 10 Nov 2020 22:17:04 +0100 Subject: [PATCH] Add integration tests for default share permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- .../features/bootstrap/SharingContext.php | 1 + .../sharing_features/sharing-v1.feature | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/build/integration/features/bootstrap/SharingContext.php b/build/integration/features/bootstrap/SharingContext.php index 09b90dbf17..4f497629a4 100644 --- a/build/integration/features/bootstrap/SharingContext.php +++ b/build/integration/features/bootstrap/SharingContext.php @@ -36,6 +36,7 @@ class SharingContext implements Context, SnippetAcceptingContext { use CommandLine; protected function resetAppConfigs() { + $this->modifyServerConfig('core', 'shareapi_default_permissions', '31'); $this->modifyServerConfig('sharebymail', 'enforcePasswordProtection', 'no'); } } diff --git a/build/integration/sharing_features/sharing-v1.feature b/build/integration/sharing_features/sharing-v1.feature index 764cd857a3..38eb2d8a81 100644 --- a/build/integration/sharing_features/sharing-v1.feature +++ b/build/integration/sharing_features/sharing-v1.feature @@ -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