summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorVincent Petry <vincent@nextcloud.com>2022-08-26 10:30:26 +0200
committerVincent Petry <vincent@nextcloud.com>2022-08-26 14:18:47 +0200
commitc1df72fc8b578e201b89793c65755f767f5073c7 (patch)
tree6e810aea9640c484a0381b9ad1fdce6a75280856 /build
parente9a344a6444d59a63a00c2a291ae6d1dbe30a24e (diff)
downloadnextcloud-server-c1df72fc8b578e201b89793c65755f767f5073c7.tar.gz
nextcloud-server-c1df72fc8b578e201b89793c65755f767f5073c7.zip
Fix copy in view-only mode
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'build')
-rwxr-xr-xbuild/composerbin0 -> 2799637 bytes
-rw-r--r--build/integration/features/bootstrap/Sharing.php2
-rw-r--r--build/integration/sharing_features/sharing-v1-part2.feature20
3 files changed, 21 insertions, 1 deletions
diff --git a/build/composer b/build/composer
new file mode 100755
index 00000000000..a3a5d90426d
--- /dev/null
+++ b/build/composer
Binary files differ
diff --git a/build/integration/features/bootstrap/Sharing.php b/build/integration/features/bootstrap/Sharing.php
index f804f64e59a..aa9244d3c2a 100644
--- a/build/integration/features/bootstrap/Sharing.php
+++ b/build/integration/features/bootstrap/Sharing.php
@@ -440,7 +440,7 @@ trait Sharing {
}
/**
- * @Given /^(file|folder|entry) "([^"]*)" of user "([^"]*)" is shared with group "([^"]*)"( with permissions ([\d]*))( view-only)?$/
+ * @Given /^(file|folder|entry) "([^"]*)" of user "([^"]*)" is shared with group "([^"]*)"( with permissions ([\d]*))?( view-only)?$/
*
* @param string $filepath
* @param string $user
diff --git a/build/integration/sharing_features/sharing-v1-part2.feature b/build/integration/sharing_features/sharing-v1-part2.feature
index ba927250649..a9e2e50ce02 100644
--- a/build/integration/sharing_features/sharing-v1-part2.feature
+++ b/build/integration/sharing_features/sharing-v1-part2.feature
@@ -1187,4 +1187,24 @@ Feature: sharing
When As an "user1"
And Downloading file "/sharedviewonly/document.odt"
Then the HTTP status code should be "403"
+
+ Scenario: Cannot copy a file when it's shared view-only
+ Given user "user0" exists
+ And user "user1" exists
+ And User "user0" moves file "/textfile0.txt" to "/document.odt"
+ And file "document.odt" of user "user0" is shared with user "user1" view-only
+ And user "user1" accepts last share
+ When User "user1" copies file "/document.odt" to "/copyforbidden.odt"
+ Then the HTTP status code should be "403"
+
+ Scenario: Cannot copy a file when its parent is shared view-only
+ Given user "user0" exists
+ And user "user1" exists
+ And User "user0" created a folder "/sharedviewonly"
+ And User "user0" moves file "/textfile0.txt" to "/sharedviewonly/document.odt"
+ And folder "sharedviewonly" of user "user0" is shared with user "user1" view-only
+ And user "user1" accepts last share
+ When User "user1" copies file "/sharedviewonly/document.odt" to "/copyforbidden.odt"
+ Then the HTTP status code should be "403"
+
# See sharing-v1-part3.feature