mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-02-05 11:38:50 -06:00
test: change share role Denied to-and-fro role in Personal and Project space
This commit is contained in:
@@ -2058,15 +2058,18 @@ class SpacesContext implements Context {
|
||||
* @return void
|
||||
* @throws GuzzleException
|
||||
*/
|
||||
public function userShouldNotBeAbleToDownloadFileInsideSpace(
|
||||
public function userShouldOrShouldNotBeAbleToDownloadFileFromSpace(
|
||||
string $user,
|
||||
string $fileName,
|
||||
string $spaceName
|
||||
): void {
|
||||
$spaceId = $this->getSpaceIdByName($user, $spaceName);
|
||||
$response = $this->featureContext->downloadFileAsUserUsingPassword(
|
||||
$user,
|
||||
$fileName,
|
||||
$this->featureContext->getPasswordForUser($user)
|
||||
$this->featureContext->getPasswordForUser($user),
|
||||
null,
|
||||
$spaceId
|
||||
);
|
||||
Assert::assertGreaterThanOrEqual(
|
||||
400,
|
||||
|
||||
@@ -5268,3 +5268,110 @@ Feature: an user gets the resources shared to them
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Brian" should not have a share "FolderToShare" shared by user "Alice" from space "NewSpace"
|
||||
And user "Brian" should not be able to download file "FolderToShare/lorem.txt" from space "Shares"
|
||||
|
||||
@env-config
|
||||
Scenario Outline: check share access after updating the permission role of a shared folder from other roles to Denied (Personal Space)
|
||||
Given using spaces DAV path
|
||||
And the administrator has enabled the permissions role "Denied"
|
||||
And user "Alice" has created folder "FolderToShare"
|
||||
And user "Alice" has uploaded file with content "hello world" to "FolderToShare/lorem.txt"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | FolderToShare |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
And user "Alice" has updated the last resource share with the following properties:
|
||||
| permissionsRole | Denied |
|
||||
| space | Personal |
|
||||
| resource | FolderToShare |
|
||||
When user "Brian" lists the shares shared with him using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Brian" should not have a share "FolderToShare" shared by user "Alice" from space "Personal"
|
||||
And user "Brian" should not be able to download file "FolderToShare/lorem.txt" from space "Shares"
|
||||
Examples:
|
||||
| permissions-role |
|
||||
| Editor |
|
||||
| Viewer |
|
||||
| Uploader |
|
||||
|
||||
@env-config
|
||||
Scenario Outline: check share access after updating the permission role of a shared folder from Denied to other roles (Personal Space)
|
||||
Given using spaces DAV path
|
||||
And the administrator has enabled the permissions role "Denied"
|
||||
And user "Alice" has created folder "FolderToShare"
|
||||
And user "Alice" has uploaded file with content "hello world" to "FolderToShare/lorem.txt"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | FolderToShare |
|
||||
| space | Personal |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Denied |
|
||||
And user "Alice" has updated the last resource share with the following properties:
|
||||
| permissionsRole | <permissions-role> |
|
||||
| space | Personal |
|
||||
| resource | FolderToShare |
|
||||
When user "Brian" lists the shares shared with him using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Brian" should have a share "FolderToShare" shared by user "Alice" from space "Personal"
|
||||
And for user "Brian" the content of the file "FolderToShare/lorem.txt" of the space "Shares" should be "hello world"
|
||||
Examples:
|
||||
| permissions-role |
|
||||
| Editor |
|
||||
| Viewer |
|
||||
| Uploader |
|
||||
|
||||
@env-config
|
||||
Scenario Outline: check share access after updating the permission role of a shared folder from other roles to Denied (Project Space)
|
||||
Given using spaces DAV path
|
||||
And the administrator has enabled the permissions role "Denied"
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
|
||||
And user "Alice" has created a folder "FolderToShare" in space "NewSpace"
|
||||
And user "Alice" has uploaded a file inside space "NewSpace" with content "hello world" to "FolderToShare/lorem.txt"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | FolderToShare |
|
||||
| space | NewSpace |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | <permissions-role> |
|
||||
And user "Alice" has updated the last resource share with the following properties:
|
||||
| permissionsRole | Denied |
|
||||
| space | NewSpace |
|
||||
| resource | FolderToShare |
|
||||
When user "Brian" lists the shares shared with him using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Brian" should not have a share "FolderToShare" shared by user "Alice" from space "NewSpace"
|
||||
Examples:
|
||||
| permissions-role |
|
||||
| Editor |
|
||||
| Viewer |
|
||||
| Uploader |
|
||||
|
||||
@env-config
|
||||
Scenario Outline: check share access after updating the permission role of a shared folder from Denied to other roles (Project Space)
|
||||
Given using spaces DAV path
|
||||
And the administrator has enabled the permissions role "Denied"
|
||||
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
|
||||
And user "Alice" has created a space "NewSpace" with the default quota using the Graph API
|
||||
And user "Alice" has created a folder "FolderToShare" in space "NewSpace"
|
||||
And user "Alice" has uploaded a file inside space "NewSpace" with content "hello world" to "FolderToShare/lorem.txt"
|
||||
And user "Alice" has sent the following resource share invitation:
|
||||
| resource | FolderToShare |
|
||||
| space | NewSpace |
|
||||
| sharee | Brian |
|
||||
| shareType | user |
|
||||
| permissionsRole | Denied |
|
||||
And user "Alice" has updated the last resource share with the following properties:
|
||||
| permissionsRole | <permissions-role> |
|
||||
| space | NewSpace |
|
||||
| resource | FolderToShare |
|
||||
When user "Brian" lists the shares shared with him using the Graph API
|
||||
Then the HTTP status code should be "200"
|
||||
And user "Brian" should have a share "FolderToShare" shared by user "Alice" from space "NewSpace"
|
||||
And for user "Brian" the content of the file "FolderToShare/lorem.txt" of the space "Shares" should be "hello world"
|
||||
Examples:
|
||||
| permissions-role |
|
||||
| Editor |
|
||||
| Viewer |
|
||||
| Uploader |
|
||||
|
||||
Reference in New Issue
Block a user