aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-01-19 11:36:24 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2025-02-04 15:39:14 +0100
commit73dc0f0f194de7a74ac70ee961f7c3a9543a98e1 (patch)
tree1d188d7da43275f8f08f98755dac7558134d62a9 /build
parent83e35b69915039a6c174be6e471145673995e439 (diff)
downloadnextcloud-server-73dc0f0f194de7a74ac70ee961f7c3a9543a98e1.tar.gz
nextcloud-server-73dc0f0f194de7a74ac70ee961f7c3a9543a98e1.zip
fix(sharing): Ensure download restrictions are not droppedfix/proper-download-check
When a user receives a share with share-permissions but also with download restrictions (hide download or the modern download permission attribute), then re-shares of that share must always also include those restrictions. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'build')
-rw-r--r--build/integration/sharing_features/sharing-v1-part2.feature73
1 files changed, 73 insertions, 0 deletions
diff --git a/build/integration/sharing_features/sharing-v1-part2.feature b/build/integration/sharing_features/sharing-v1-part2.feature
index 8cc97fe71ee..e4da8436508 100644
--- a/build/integration/sharing_features/sharing-v1-part2.feature
+++ b/build/integration/sharing_features/sharing-v1-part2.feature
@@ -701,6 +701,79 @@ Feature: sharing
Then the OCS status code should be "404"
And the HTTP status code should be "200"
+ Scenario: download restrictions can not be dropped
+ As an "admin"
+ Given user "user0" exists
+ And user "user1" exists
+ And user "user2" exists
+ And User "user0" uploads file with content "foo" to "/tmp.txt"
+ And As an "user0"
+ And creating a share with
+ | path | /tmp.txt |
+ | shareType | 0 |
+ | shareWith | user1 |
+ | permissions | 17 |
+ | attributes | [{"scope":"permissions","key":"download","value":false}] |
+ And As an "user1"
+ And accepting last share
+ When Getting info of last share
+ Then Share fields of last share match with
+ | uid_owner | user0 |
+ | uid_file_owner | user0 |
+ | permissions | 17 |
+ | attributes | [{"scope":"permissions","key":"download","value":false}] |
+ When creating a share with
+ | path | /tmp.txt |
+ | shareType | 0 |
+ | shareWith | user2 |
+ | permissions | 1 |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When As an "user2"
+ And accepting last share
+ And Getting info of last share
+ Then Share fields of last share match with
+ | share_type | 0 |
+ | permissions | 1 |
+ | uid_owner | user1 |
+ | uid_file_owner | user0 |
+ | attributes | [{"scope":"permissions","key":"download","value":false}] |
+
+ Scenario: download restrictions can not be dropped when re-sharing even on link shares
+ As an "admin"
+ Given user "user0" exists
+ And user "user1" exists
+ And User "user0" uploads file with content "foo" to "/tmp.txt"
+ And As an "user0"
+ And creating a share with
+ | path | /tmp.txt |
+ | shareType | 0 |
+ | shareWith | user1 |
+ | permissions | 17 |
+ | attributes | [{"scope":"permissions","key":"download","value":false}] |
+ And As an "user1"
+ And accepting last share
+ When Getting info of last share
+ Then Share fields of last share match with
+ | uid_owner | user0 |
+ | attributes | [{"scope":"permissions","key":"download","value":false}] |
+ When creating a share with
+ | path | /tmp.txt |
+ | shareType | 3 |
+ | permissions | 1 |
+ And Getting info of last share
+ And Updating last share with
+ | hideDownload | false |
+ Then the OCS status code should be "100"
+ And the HTTP status code should be "200"
+ When Getting info of last share
+ Then Share fields of last share match with
+ | share_type | 3 |
+ | uid_owner | user1 |
+ | uid_file_owner | user0 |
+ | hide_download | 1 |
+ | attributes | [{"scope":"permissions","key":"download","value":false}] |
+
Scenario: User is not allowed to reshare file with additional delete permissions
As an "admin"
Given user "user0" exists