diff --git a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature index 83282e70f6..e81cf71fa3 100644 --- a/tests/acceptance/features/apiSpacesShares/shareSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/shareSpaces.feature @@ -136,3 +136,34 @@ Feature: Share spaces | viewer | manager | | viewer | editor | | viewer | viewer | + + + Scenario Outline: space manager can change the role of space members + Given user "Alice" has shared a space "share space" to user "Brian" with role "" + When user "Alice" updates the space "share space" for user "Brian" changing the role to "" + Then the HTTP status code should be "200" + And the OCS status code should be "200" + And the user "Alice" should have a space called "share space" granted to "Brian" with role "" + Examples: + | role | new_role | + | editor | manager | + | editor | viewer | + | viewer | manager | + | viewer | editor | + | manager | editor | + | manager | viewer | + + + Scenario Outline: user without manager role cannot change the role of space members + Given user "Alice" has shared a space "share space" to user "Brian" with role "" + And user "Alice" has shared a space "share space" to user "Bob" with role "viewer" + When user "Brian" updates the space "share space" for user "Bob" changing the role to "" + Then the HTTP status code should be "404" + And the OCS status code should be "404" + And the user "Alice" should have a space called "share space" granted to "Bob" with role "viewer" + Examples: + | role | new_role | + | editor | manager | + | editor | viewer | + | viewer | manager | + | viewer | editor | diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 9ab90311d3..12110fa994 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1682,8 +1682,7 @@ class SpacesContext implements Context { string $fileName, string $spaceName ):void { - $space = $this->getSpaceByName($user, $spaceName); - $fullUrl = $space["root"]["webDavUrl"] . '/' . ltrim($fileName, "/"); + $this->setSpaceIDByName($user, $spaceName); $this->featureContext->downloadFileAsUserUsingPassword($user, $fileName, $this->featureContext->getPasswordForUser($user)); Assert::assertGreaterThanOrEqual( 400, @@ -1790,6 +1789,7 @@ class SpacesContext implements Context { /** * @When /^user "([^"]*)" shares a space "([^"]*)" to user "([^"]*)" with role "([^"]*)"$/ + * @When /^user "([^"]*)" updates the space "([^"]*)" for user "([^"]*)" changing the role to "([^"]*)"$/ * * @param string $user * @param string $spaceName