From f0c4bb5a0c5c3845dc141d022d3dadf0b7cd7226 Mon Sep 17 00:00:00 2001 From: Niraj Acharya Date: Fri, 24 May 2024 09:43:47 +0545 Subject: [PATCH] adding test for deleting/removing share link of file and folder in project space using root endpoint --- ...ected-failures-localAPI-on-OCIS-storage.md | 1 + .../apiSharingNg/removeAccessToDrive.feature | 50 +++++++++++++------ .../features/bootstrap/SharingNgContext.php | 4 +- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 5f8726e9e2..e16fb4f674 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -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) diff --git a/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature b/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature index e616e7e254..1a117a4d5b 100644 --- a/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature +++ b/tests/acceptance/features/apiSharingNg/removeAccessToDrive.feature @@ -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: @@ -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 @@ -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" @@ -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" @@ -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: @@ -134,7 +134,7 @@ 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 @@ -142,7 +142,7 @@ Feature: Remove access to a drive 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" @@ -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: @@ -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: @@ -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: @@ -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: @@ -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 | | + | 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" diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index 1a1a9230a4..51dd204c93 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -1583,14 +1583,14 @@ class SharingNgContext implements Context { } /** - * @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, '')); } }