From e09a7233846ccc58fe00f065c01b66bfed39bc90 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Mon, 14 Nov 2022 10:14:43 +0545 Subject: [PATCH 1/2] Added api test for sharing spaces without manager permission --- .../apiSpacesShares/shareSpaces.feature | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index e26dacf82..23cf60579 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -17,7 +17,7 @@ Feature: Share spaces And using spaces DAV path - Scenario Outline:: A user can share a space to another user + Scenario Outline:: A Space Admin can share a space to another user When user "Alice" shares a space "share space" to user "Brian" with role "" Then the HTTP status code should be "200" And the OCS status code should be "200" @@ -101,3 +101,20 @@ Feature: Share spaces | manager | | editor | | viewer | + + + Scenario Outline: A user without manager role cannot share a space to another user + Given user "Alice" has shared a space "share space" to user "Brian" with role "" + When user "Brian" shares a space "share space" to user "Bob" with role "" + Then the HTTP status code should be "404" + And the OCS status code should be "404" + And the OCS status message should be "No share permission" + And the user "Bob" should not have a space called "share space" + Examples: + | role | new_role | + | editor | manager | + | editor | editor | + | editor | viewer | + | viewer | manager | + | viewer | editor | + | viewer | viewer | From 923c84d361996f24ee03552d7bc20897c2c70a76 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Tue, 15 Nov 2022 09:45:22 +0545 Subject: [PATCH 2/2] Added api test for sharing spaces with manager permission --- .../apiSpacesShares/shareSpaces.feature | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index 23cf60579..83282e70f 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -103,7 +103,25 @@ Feature: Share spaces | viewer | - Scenario Outline: A user without manager role cannot share a space to another user + Scenario Outline: A user with manager role can share a space to another user + Given user "Alice" has shared a space "share space" to user "Brian" with role "manager" + When user "Brian" shares a space "share space" to user "Bob" with role "" + Then the HTTP status code should be "200" + And the OCS status code should be "200" + And the OCS status message should be "OK" + And the user "Bob" should have a space called "share space" with these key and value pairs: + | key | value | + | driveType | project | + | id | %space_id% | + | name | share space | + Examples: + | role | + | manager | + | editor | + | viewer | + + + Scenario Outline: A user with editor or viewer role cannot share a space to another user Given user "Alice" has shared a space "share space" to user "Brian" with role "" When user "Brian" shares a space "share space" to user "Bob" with role "" Then the HTTP status code should be "404"