aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorskjnldsv <skjnldsv@protonmail.com>2024-08-22 10:02:37 +0200
committerskjnldsv <skjnldsv@protonmail.com>2024-09-11 13:55:06 +0200
commitb9ef97260d9c904f6ed835c889092f1e9b7c8b05 (patch)
treec7486edce1fac276645c2a0a9dd11d136a0aa082 /build
parentc80dd9dfecbf5dc6cf8a827ef62f9c27eea7a776 (diff)
downloadnextcloud-server-b9ef97260d9c904f6ed835c889092f1e9b7c8b05.tar.gz
nextcloud-server-b9ef97260d9c904f6ed835c889092f1e9b7c8b05.zip
fix(files_sharing): adjust permissions from custom edit and delete check methodsbackport/47339/stable29
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'build')
-rw-r--r--build/integration/sharing_features/sharing-v1-part4.feature83
1 files changed, 83 insertions, 0 deletions
diff --git a/build/integration/sharing_features/sharing-v1-part4.feature b/build/integration/sharing_features/sharing-v1-part4.feature
index ae4e69f2622..b180ad08072 100644
--- a/build/integration/sharing_features/sharing-v1-part4.feature
+++ b/build/integration/sharing_features/sharing-v1-part4.feature
@@ -39,3 +39,86 @@ Scenario: Creating a new share of a file you own shows the file permissions
And the HTTP status code should be "200"
And Share fields of last share match with
| item_permissions | 27 |
+
+Scenario: Receiving a share of a file gives no create permission
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_permissions" of app "core" is set to "31"
+ And file "welcome.txt" of user "user0" is shared with user "user1"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
+ And share 0 is returned with
+ | path | /welcome.txt |
+ | permissions | 19 |
+ | item_permissions | 27 |
+ When As an "user1"
+ And user "user1" accepts last share
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
+ Then the list of returned shares has 1 shares
+ And share 0 is returned with
+ | path | /welcome (2).txt |
+ | permissions | 19 |
+ | item_permissions | 27 |
+
+Scenario: Receiving a share of a folder gives create permission
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_permissions" of app "core" is set to "31"
+ And file "PARENT/CHILD" of user "user0" is shared with user "user1"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
+ And share 0 is returned with
+ | path | /PARENT/CHILD |
+ | permissions | 31 |
+ | item_permissions | 31 |
+ When As an "user1"
+ And user "user1" accepts last share
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
+ Then the list of returned shares has 1 shares
+ And share 0 is returned with
+ | path | /CHILD |
+ | permissions | 31 |
+ | item_permissions | 31 |
+
+# User can remove itself from a share
+Scenario: Receiving a share of a file without delete permission gives delete permission anyway
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And parameter "shareapi_default_permissions" of app "core" is set to "23"
+ And file "welcome.txt" of user "user0" is shared with user "user1"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
+ And share 0 is returned with
+ | path | /welcome.txt |
+ | permissions | 19 |
+ | item_permissions | 27 |
+ When As an "user1"
+ And user "user1" accepts last share
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
+ Then the list of returned shares has 1 shares
+ And share 0 is returned with
+ | path | /welcome (2).txt |
+ | permissions | 19 |
+ | item_permissions | 27 |
+
+Scenario: Receiving a share of a file without delete permission gives delete permission anyway
+ Given user "user0" exists
+ And user "user1" exists
+ And As an "user0"
+ And group "group1" exists
+ And user "user1" belongs to group "group1"
+ And parameter "shareapi_default_permissions" of app "core" is set to "23"
+ And file "welcome.txt" of user "user0" is shared with group "group1"
+ And sending "GET" to "/apps/files_sharing/api/v1/shares"
+ And share 0 is returned with
+ | path | /welcome.txt |
+ | permissions | 19 |
+ | item_permissions | 27 |
+ When As an "user1"
+ And user "user1" accepts last share
+ And sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
+ Then the list of returned shares has 1 shares
+ And share 0 is returned with
+ | path | /welcome (2).txt |
+ | permissions | 19 |
+ | item_permissions | 27 |