Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only][full-ci] adding test for removing link share of a project space using permissions endpoint #9246

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ The expected failures in this file are from features in the owncloud/ocis repo.
- [apiSharingNg/removeAccessToDriveItem.feature:179](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDriveItem.feature#L179)
- [apiSharingNg/removeAccessToDrive.feature:177](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature#L177)
- [apiSharingNg/removeAccessToDrive.feature:206](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature#L206)
- [apiSharingNg/removeAccessToDrive.feature:236](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature#L236)

### [sharee (editor role) MOVE a file by file-id into same shared folder returns 403](https://github.com/owncloud/ocis/issues/7617)

Expand Down
50 changes: 35 additions & 15 deletions tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Feature: Remove access to a drive
And using spaces DAV path


Scenario Outline: user removes user member from project space
Scenario Outline: user removes user member from project space using root endpoint
Given 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 sent the following space share invitation:
Expand All @@ -28,7 +28,7 @@ Feature: Remove access to a drive
| Manager |

@issue-8768
Scenario Outline: user removes group from project space
Scenario Outline: user removes group from project space using root endpoint
Given 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 group "group1" has been created
Expand All @@ -48,7 +48,7 @@ Feature: Remove access to a drive
| Manager |


Scenario Outline: user of a group removes another user from project space
Scenario Outline: user of a group removes another user from project space using root endpoint
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And group "group1" has been created
And user "Brian" has been added to group "group1"
Expand All @@ -73,7 +73,7 @@ Feature: Remove access to a drive
| Manager | 204 | should not |


Scenario Outline: user of a group removes own group from project space
Scenario Outline: user of a group removes own group from project space using root endpoint
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And group "group1" has been created
And user "Brian" has been added to group "group1"
Expand All @@ -93,7 +93,7 @@ Feature: Remove access to a drive
| Manager | 204 | should not |

@issue-8819
Scenario Outline: user removes himself from the project space
Scenario Outline: user removes himself from the project space using root endpoint
Given 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 sent the following space share invitation:
Expand Down Expand Up @@ -134,15 +134,15 @@ Feature: Remove access to a drive
| Manager | 204 | should not |


Scenario: user cannot remove himself from the project space if he is the last manager
Scenario: user cannot remove himself from the project space if he is the last manager using root endpoint
Given 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
When user "Alice" tries to remove the access of user "Alice" from space "NewSpace" using root endpoint of the Graph API
Then the HTTP status code should be "403"
And the user "Alice" should have a space called "NewSpace"


Scenario: user of a group cannot remove own group from project space if it is the last manager
Scenario: user of a group cannot remove own group from project space if it is the last manager using root endpoint
Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And group "group1" has been created
And user "Brian" has been added to group "group1"
Expand All @@ -158,7 +158,7 @@ Feature: Remove access to a drive
And the user "Brian" should have a space called "NewSpace"

@issue-7879
Scenario Outline: user removes link share from project space
Scenario Outline: user removes link share from project space using root endpoint
Given 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 the following space link share:
Expand All @@ -177,7 +177,7 @@ Feature: Remove access to a drive
| blocksDownload |


Scenario: user removes internal link share from project space
Scenario: user removes internal link share from project space using root endpoint
Given 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 the following space link share:
Expand All @@ -188,7 +188,7 @@ Feature: Remove access to a drive
And user "Alice" should not have any "link" permissions on space "NewSpace"

@issue-7879
Scenario Outline: user tries to remove link share of project space owned by next user
Scenario Outline: user tries to remove link share of project space owned by next user using root endpoint
Given 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 the following space link share:
Expand All @@ -206,7 +206,7 @@ Feature: Remove access to a drive
| blocksDownload |


Scenario: user tries to remove internal link share of project space owned by next user
Scenario: user tries to remove internal link share of project space owned by next user using root endpoint
Given 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 the following space link share:
Expand All @@ -216,13 +216,33 @@ Feature: Remove access to a drive
Then the HTTP status code should be "404"


Scenario: remove link share of a project drive using permissions endpoint
Scenario Outline: user removes link share of a project drive using permissions endpoint
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
And user "Alice" has created the following space link share:
| space | projectSpace |
| permissionsRole | <permissions-role> |
| password | %public% |
When user "Alice" removes the last link share of space "projectSpace" using permissions endpoint of the Graph API
Then the HTTP status code should be "204"
And user "Alice" should not have any "link" permissions on space "projectSpace"
Examples:
| permissions-role |
| view |
| edit |
| upload |
| createOnly |
| blocksDownload |


Scenario: user removes internal link share of a project drive using permissions endpoint
Given using spaces DAV path
And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API
And user "Alice" has created a space "projectSpace" with the default quota using the Graph API
And user "Alice" has created the following space link share:
| space | projectSpace |
| permissionsRole | view |
| password | $heLlo*1234* |
When user "Alice" deletes the last link share of space "projectSpace" using permissions endpoint of the Graph API
| permissionsRole | internal |
When user "Alice" removes the last link share of space "projectSpace" using permissions endpoint of the Graph API
Then the HTTP status code should be "204"
And user "Alice" should not have any "link" permissions on space "projectSpace"
4 changes: 2 additions & 2 deletions tests/acceptance/features/bootstrap/SharingNgContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -1583,14 +1583,14 @@ public function userTriesToListThePermissionsOfSpaceOwnedByUsingRootEndpointOfTh
}

/**
* @When user :user deletes the last link share of space :space using permissions endpoint of the Graph API
* @When user :user removes the last link share of space :space using permissions endpoint of the Graph API
*
* @param string $user
* @param string $space
*
* @return void
*/
public function userDeletsTheLastLinkShareOfSpaceUsingPermissionsEndpointOfGraphApi(string $user, string $space):void {
public function userRemovesTheLastLinkShareOfSpaceUsingPermissionsEndpointOfGraphApi(string $user, string $space):void {
$this->featureContext->setResponse($this->removeAccessToSpaceItem($user, 'link', $space, ''));
}
}