diff options
author | Sergio Bertolin <sbertolin@solidgear.es> | 2016-11-15 20:35:41 +0300 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-11-24 17:15:52 +0300 |
commit | 667903a9033764765c61d7b3837e4f58cb88a75f (patch) | |
tree | b083199432c73d775170d3a41cc7e9c7b83c6efc /build | |
parent | d90e958b0f4143490f156ced568caf61dd41f246 (diff) |
Added tests about permissions and public upload
Added read and share permissions instead of all (default ones)
Added positive case
Check also permissions update
Added tests for resharing with public links when the user doesn't have enough permisssions
Diffstat (limited to 'build')
-rw-r--r-- | build/integration/features/sharing-v1.feature | 175 |
1 files changed, 175 insertions, 0 deletions
diff --git a/build/integration/features/sharing-v1.feature b/build/integration/features/sharing-v1.feature index 7d773b6fe23..1611c930ff0 100644 --- a/build/integration/features/sharing-v1.feature +++ b/build/integration/features/sharing-v1.feature @@ -766,6 +766,66 @@ Feature: sharing Then the OCS status code should be "100" And the HTTP status code should be "200" + Scenario: sharing subfolder when parent already shared + Given As an "admin" + Given user "user0" exists + Given user "user1" exists + And group "sharing-group" exists + And user "user0" created a folder "/test" + And user "user0" created a folder "/test/sub" + And file "/test" of user "user0" is shared with group "sharing-group" + And As an "user0" + When sending "POST" to "/apps/files_sharing/api/v1/shares" with + | path | /test/sub | + | shareWith | user1 | + | shareType | 0 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And as "user1" the folder "/sub" exists + + Scenario: sharing subfolder when parent already shared with group of sharer + Given As an "admin" + Given user "user0" exists + Given user "user1" exists + And group "sharing-group" exists + And user "user0" belongs to group "sharing-group" + And user "user0" created a folder "/test" + And user "user0" created a folder "/test/sub" + And file "/test" of user "user0" is shared with group "sharing-group" + And As an "user0" + When sending "POST" to "/apps/files_sharing/api/v1/shares" with + | path | /test/sub | + | shareWith | user1 | + | shareType | 0 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And as "user1" the folder "/sub" exists + + Scenario: sharing subfolder of already shared folder, GET result is correct + Given As an "admin" + Given user "user0" exists + Given user "user1" exists + Given user "user2" exists + Given user "user3" exists + Given user "user4" exists + And user "user0" created a folder "/folder1" + And file "/folder1" of user "user0" is shared with user "user1" + And file "/folder1" of user "user0" is shared with user "user2" + And user "user0" created a folder "/folder1/folder2" + And file "/folder1/folder2" of user "user0" is shared with user "user3" + And file "/folder1/folder2" of user "user0" is shared with user "user4" + And As an "user0" + When sending "GET" to "/apps/files_sharing/api/v1/shares" + Then the OCS status code should be "100" + And the HTTP status code should be "200" + And the response contains 4 entries + And File "/folder1" should be included as path in the response + And File "/folder1/folder2" should be included as path in the response + And sending "GET" to "/apps/files_sharing/api/v1/shares?path=/folder1/folder2" + And the response contains 2 entries + And File "/folder1" should not be included as path in the response + And File "/folder1/folder2" should be included as path in the response + Scenario: unshare from self Given As an "admin" And user "user0" exists @@ -780,3 +840,118 @@ Feature: sharing When Deleting last share Then etag of element "/" of user "user1" has changed And etag of element "/PARENT" of user "user0" has not changed + + Scenario: Increasing permissions is allowed for owner + Given As an "admin" + And user "user0" exists + And user "user1" exists + And group "new-group" exists + And user "user0" belongs to group "new-group" + And user "user1" belongs to group "new-group" + And Assure user "user0" is subadmin of group "new-group" + And As an "user0" + And folder "/FOLDER" of user "user0" is shared with group "new-group" + And Updating last share with + | permissions | 0 | + When Updating last share with + | permissions | 31 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: Adding public upload to a read only shared folder as recipient is not allowed + Given As an "admin" + And user "user0" exists + And user "user1" exists + And As an "user0" + And user "user0" created a folder "/test" + And folder "/test" of user "user0" is shared with user "user1" with permissions 17 + And As an "user1" + And creating a share with + | path | /test | + | shareType | 3 | + | publicUpload | false | + When Updating last share with + | publicUpload | true | + Then the OCS status code should be "404" + And the HTTP status code should be "200" + + Scenario: Adding public upload to a shared folder as recipient is allowed with permissions + Given As an "admin" + And user "user0" exists + And user "user1" exists + And As an "user0" + And user "user0" created a folder "/test" + And folder "/test" of user "user0" is shared with user "user1" with permissions 31 + And As an "user1" + And creating a share with + | path | /test | + | shareType | 3 | + | publicUpload | false | + When Updating last share with + | publicUpload | true | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: Adding public upload to a read only shared folder as recipient is not allowed + Given As an "admin" + And user "user0" exists + And user "user1" exists + And As an "user0" + And user "user0" created a folder "/test" + And folder "/test" of user "user0" is shared with user "user1" with permissions 17 + And As an "user1" + And creating a share with + | path | /test | + | shareType | 3 | + | permissions | 1 | + When Updating last share with + | permissions | 7 | + Then the OCS status code should be "404" + And the HTTP status code should be "200" + + Scenario: Adding public upload to a shared folder as recipient is allowed with permissions + Given As an "admin" + And user "user0" exists + And user "user1" exists + And As an "user0" + And user "user0" created a folder "/test" + And folder "/test" of user "user0" is shared with user "user1" with permissions 31 + And As an "user1" + And creating a share with + | path | /test | + | shareType | 3 | + | permissions | 1 | + When Updating last share with + | permissions | 7 | + Then the OCS status code should be "100" + And the HTTP status code should be "200" + + Scenario: resharing using a public link with read only permissions is not allowed + Given As an "admin" + And user "user0" exists + And user "user1" exists + And As an "user0" + And user "user0" created a folder "/test" + And folder "/test" of user "user0" is shared with user "user1" with permissions 1 + And As an "user1" + And creating a share with + | path | /test | + | shareType | 3 | + | publicUpload | false | + Then the OCS status code should be "404" + And the HTTP status code should be "200" + + Scenario: resharing using a public link with read and write permissions only is not allowed + Given As an "admin" + And user "user0" exists + And user "user1" exists + And As an "user0" + And user "user0" created a folder "/test" + And folder "/test" of user "user0" is shared with user "user1" with permissions 15 + And As an "user1" + And creating a share with + | path | /test | + | shareType | 3 | + | publicUpload | false | + Then the OCS status code should be "404" + And the HTTP status code should be "200" |