Merge pull request #4381 from owncloud/selectOnlyAvailableRoleForSpaceShare
[tests-only][full-ci]Select Available role only while sharing space
This commit is contained in:
@@ -437,7 +437,7 @@ Feature: copy file
|
|||||||
Scenario Outline: User copies a folder from space shares jail with different role to space project with role viewer
|
Scenario Outline: User copies a folder from space shares jail with different role to space project with role viewer
|
||||||
Given the administrator has given "Brian" the role "Space Admin" using the settings api
|
Given the administrator has given "Brian" the role "Space Admin" using the settings api
|
||||||
And user "Brian" has created a space "Project" with the default quota using the GraphApi
|
And user "Brian" has created a space "Project" with the default quota using the GraphApi
|
||||||
And user "Brian" has shared a space "Project" to user "Alice" with role "<role>"
|
And user "Brian" has shared a space "Project" to user "Alice" with role "viewer"
|
||||||
And user "Brian" has created folder "/testshare"
|
And user "Brian" has created folder "/testshare"
|
||||||
And user "Brian" has created folder "/testshare/folder1"
|
And user "Brian" has created folder "/testshare/folder1"
|
||||||
And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt"
|
And user "Brian" has uploaded file with content "testshare content" to "/testshare/folder1/testshare.txt"
|
||||||
@@ -450,4 +450,4 @@ Feature: copy file
|
|||||||
Examples:
|
Examples:
|
||||||
| permissions |
|
| permissions |
|
||||||
| 31 |
|
| 31 |
|
||||||
| 17 |
|
| 17 |
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Feature: move (rename) file
|
|||||||
And user "Brian" has created a space "Project" with the default quota using the GraphApi
|
And user "Brian" has created a space "Project" with the default quota using the GraphApi
|
||||||
And user "Brian" has created a folder "newfolder" in space "Project"
|
And user "Brian" has created a folder "newfolder" in space "Project"
|
||||||
And user "Brian" has uploaded a file inside space "Project" with content "some content" to "insideSpace.txt"
|
And user "Brian" has uploaded a file inside space "Project" with content "some content" to "insideSpace.txt"
|
||||||
And user "Brian" has shared a space "Project" to user "Alice" with role "<role>"
|
And user "Brian" has shared a space "Project" to user "Alice" with role "viewer"
|
||||||
When user "Alice" moves file "insideSpace.txt" to "newfolder/insideSpace.txt" in space "Project" using the WebDAV API
|
When user "Alice" moves file "insideSpace.txt" to "newfolder/insideSpace.txt" in space "Project" using the WebDAV API
|
||||||
Then the HTTP status code should be "403"
|
Then the HTTP status code should be "403"
|
||||||
And for user "Alice" the space "Project" should not contain these entries:
|
And for user "Alice" the space "Project" should not contain these entries:
|
||||||
|
|||||||
@@ -1996,6 +1996,10 @@ class SpacesContext implements Context {
|
|||||||
string $role
|
string $role
|
||||||
): void {
|
): void {
|
||||||
$space = $this->getSpaceByName($user, $spaceName);
|
$space = $this->getSpaceByName($user, $spaceName);
|
||||||
|
$availableRoleToAssignToShareSpace = ['manager', 'editor', 'viewer'];
|
||||||
|
if (!\in_array(\strtolower($role), $availableRoleToAssignToShareSpace)) {
|
||||||
|
throw new Error("The Selected " . $role . " Cannot be Found");
|
||||||
|
}
|
||||||
$body = [
|
$body = [
|
||||||
"space_ref" => $space['id'],
|
"space_ref" => $space['id'],
|
||||||
"shareType" => 7,
|
"shareType" => 7,
|
||||||
@@ -2004,7 +2008,6 @@ class SpacesContext implements Context {
|
|||||||
];
|
];
|
||||||
|
|
||||||
$fullUrl = $this->baseUrl . $this->ocsApiUrl;
|
$fullUrl = $this->baseUrl . $this->ocsApiUrl;
|
||||||
|
|
||||||
$this->featureContext->setResponse(
|
$this->featureContext->setResponse(
|
||||||
$this->sendPostRequestToUrl(
|
$this->sendPostRequestToUrl(
|
||||||
$fullUrl,
|
$fullUrl,
|
||||||
@@ -2118,7 +2121,6 @@ class SpacesContext implements Context {
|
|||||||
string $role
|
string $role
|
||||||
): void {
|
): void {
|
||||||
$this->sendShareSpaceRequest($user, $spaceName, $userRecipient, $role);
|
$this->sendShareSpaceRequest($user, $spaceName, $userRecipient, $role);
|
||||||
|
|
||||||
$expectedHTTPStatus = "200";
|
$expectedHTTPStatus = "200";
|
||||||
$this->featureContext->theHTTPStatusCodeShouldBe(
|
$this->featureContext->theHTTPStatusCodeShouldBe(
|
||||||
$expectedHTTPStatus,
|
$expectedHTTPStatus,
|
||||||
|
|||||||
Reference in New Issue
Block a user