Merge pull request #10703 from owncloud/test/change-share-role-Denied-to-and-fro

[tests-only][full-ci] Tests for checking share access after changing share role to and from "Denied"
This commit is contained in:
Pradip Subedi
2025-01-01 17:25:27 +05:45
committed by GitHub
2 changed files with 112 additions and 2 deletions

View File

@@ -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,

View File

@@ -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 |