diff --git a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md index 6bce9415bac..7c4a68c113d 100644 --- a/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md +++ b/tests/acceptance/expected-failures-localAPI-on-OCIS-storage.md @@ -212,6 +212,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiLocks/lockFiles.feature:369](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L369) ### [Anonymous users can unlock a file shared to them through a public link if they get the lock token](https://github.com/owncloud/ocis/issues/7761) + - [apiLocks/unlockFiles.feature:40](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L40) - [apiLocks/unlockFiles.feature:41](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L41) - [apiLocks/unlockFiles.feature:42](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L42) @@ -220,6 +221,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiLocks/unlockFiles.feature:45](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L45) ### [Trying to unlock a shared file with sharer's lock token gives 500](https://github.com/owncloud/ocis/issues/7767) + - [apiLocks/unlockFiles.feature:107](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L107) - [apiLocks/unlockFiles.feature:108](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L108) - [apiLocks/unlockFiles.feature:109](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L109) @@ -234,6 +236,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiLocks/unlockFiles.feature:134](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/unlockFiles.feature#L134) ### [Anonymous user trying lock a file shared to them through a public link gives 405](https://github.com/owncloud/ocis/issues/7790) + - [apiLocks/lockFiles.feature:474](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L474) - [apiLocks/lockFiles.feature:475](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L475) - [apiLocks/lockFiles.feature:476](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L476) @@ -248,6 +251,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiLocks/lockFiles.feature:501](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L501) ### [anonymous user with viewer role in public link of a folder can lock a file inside it](https://github.com/owncloud/ocis/issues/7785) + - [apiLocks/lockFiles.feature:452](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L452) - [apiLocks/lockFiles.feature:453](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L453) - [apiLocks/lockFiles.feature:454](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L454) @@ -256,6 +260,7 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiLocks/lockFiles.feature:457](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiLocks/lockFiles.feature#L457) ### [blocksDownload link type is not implemented yet (sharing-ng)](https://github.com/owncloud/ocis/issues/7879) + - [apiSharingNg/linkShare.feature:78](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/linkShare.feature#L78) - [apiSharingNg/linkShare.feature:147](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/linkShare.feature#L147) - [apiSharingNg/linkShare.feature:225](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/linkShare.feature#L225) @@ -265,5 +270,71 @@ The expected failures in this file are from features in the owncloud/ocis repo. - [apiSharingNg/linkShare.feature:447](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/linkShare.feature#L447) - [apiSharingNg/linkShare.feature:448](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/linkShare.feature#L448) - [apiSharingNg/linkShare.feature:449](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSharingNg/linkShare.feature#L449) + +### [sharee (editor role) MOVE a file by file-id into same shared folder returns 403](https://github.com/owncloud/ocis/issues/7617) + +- [apiSpacesDavOperation/moveByFileId.feature:407](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L407) +- [apiSpacesDavOperation/moveByFileId.feature:408](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L408) +- [apiSpacesDavOperation/moveByFileId.feature:409](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L409) +- [apiSpacesDavOperation/moveByFileId.feature:410](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L410) +- [apiSpacesDavOperation/moveByFileId.feature:629](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L629) +- [apiSpacesDavOperation/moveByFileId.feature:630](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L630) +- [apiSpacesDavOperation/moveByFileId.feature:631](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L631) +- [apiSpacesDavOperation/moveByFileId.feature:632](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L632) + +### [MOVE a file from Project space (manager/editor) to Personal space returns 502 code](https://github.com/owncloud/ocis/issues/7618) + +- [apiSpacesDavOperation/moveByFileId.feature:117](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L117) +- [apiSpacesDavOperation/moveByFileId.feature:118](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L118) +- [apiSpacesDavOperation/moveByFileId.feature:120](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L120) +- [apiSpacesDavOperation/moveByFileId.feature:121](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L121) +- [apiSpacesDavOperation/moveByFileId.feature:139](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L139) +- [apiSpacesDavOperation/moveByFileId.feature:140](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L140) +- [apiSpacesDavOperation/moveByFileId.feature:362](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L362) +- [apiSpacesDavOperation/moveByFileId.feature:363](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L363) +- [apiSpacesDavOperation/moveByFileId.feature:365](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L365) +- [apiSpacesDavOperation/moveByFileId.feature:366](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L366) +- [apiSpacesDavOperation/moveByFileId.feature:384](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L384) +- [apiSpacesDavOperation/moveByFileId.feature:385](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L385) +- [apiSpacesShares/moveSpaces.feature:95](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L95) +- [apiSpacesShares/moveSpaces.feature:96](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L96) +- [apiSpacesShares/moveSpaces.feature:143](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L143) +- [apiSpacesShares/moveSpaces.feature:144](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L144) + +### [MOVE a file from Project space (manager/editor) to Project space (manager/editor) returns 502 code](https://github.com/owncloud/ocis/issues/8116) + +- [apiSpacesDavOperation/moveByFileId.feature:264](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L264) +- [apiSpacesDavOperation/moveByFileId.feature:265](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L265) +- [apiSpacesDavOperation/moveByFileId.feature:266](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L266) +- [apiSpacesDavOperation/moveByFileId.feature:267](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L267) +- [apiSpacesDavOperation/moveByFileId.feature:273](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L273) +- [apiSpacesDavOperation/moveByFileId.feature:274](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L274) +- [apiSpacesDavOperation/moveByFileId.feature:275](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L275) +- [apiSpacesDavOperation/moveByFileId.feature:276](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L276) +- [apiSpacesDavOperation/moveByFileId.feature:302](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L302) +- [apiSpacesDavOperation/moveByFileId.feature:303](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L303) +- [apiSpacesShares/moveSpaces.feature:69](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L69) +- [apiSpacesShares/moveSpaces.feature:70](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L70) +- [apiSpacesShares/moveSpaces.feature:71](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L71) +- [apiSpacesShares/moveSpaces.feature:72](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesShares/moveSpaces.feature#L72) + +### [sharee (editor role) MOVE a file by file-id into Personal space responds with 502 instead of 403](https://github.com/owncloud/ocis/issues/8124) + +- [apiSpacesDavOperation/moveByFileId.feature:486](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L486) +- [apiSpacesDavOperation/moveByFileId.feature:487](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L487) +- [apiSpacesDavOperation/moveByFileId.feature:488](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L488) +- [apiSpacesDavOperation/moveByFileId.feature:489](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L489) + +### [sharee (editor role) MOVE a file by file-id into Project space (manager/editor role) responds with 502 instead of 403](https://github.com/owncloud/ocis/issues/8125) + +- [apiSpacesDavOperation/moveByFileId.feature:513](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L513) +- [apiSpacesDavOperation/moveByFileId.feature:514](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L514) +- [apiSpacesDavOperation/moveByFileId.feature:516](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L516) +- [apiSpacesDavOperation/moveByFileId.feature:517](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L517) +- [apiSpacesDavOperation/moveByFileId.feature:522](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L522) +- [apiSpacesDavOperation/moveByFileId.feature:523](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L523) +- [apiSpacesDavOperation/moveByFileId.feature:525](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L525) +- [apiSpacesDavOperation/moveByFileId.feature:526](https://github.com/owncloud/ocis/blob/master/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature#L526) + - Note: always have an empty line at the end of this file. -The bash script that processes this file requires that the last line has a newline on the end. + The bash script that processes this file requires that the last line has a newline on the end. diff --git a/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature b/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature index 6eb37b8ce98..97767308acc 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/moveByFileId.feature @@ -74,18 +74,112 @@ Feature: moving/renaming file using file id | /dav/spaces/<> | - Scenario Outline: move a file into a folder inside project space + Scenario Outline: move a file from personal to share space + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/folder" + And user "Alice" has shared folder "/folder" with user "Brian" with permissions "" + And user "Brian" has uploaded file with content "some data" to "/test.txt" + And we save it into "FILEID" + When user "Brian" moves a file "test.txt" into "folder" inside space "Shares" using file-id path "" + Then the HTTP status code should be "403" + And the value of the item "/d:error/s:message" in the response about user "Brian" should be "cross storage moves are not permitted, use copy and delete" + And for user "Brian" folder "/" of the space "Personal" should contain these files: + | test.txt | + But for user "Alice" folder "folder" of the space "Personal" should not contain these files: + | test.txt | + Examples: + | permissions | dav-path | + | all | /remote.php/dav/spaces/<> | + | all | /dav/spaces/<> | + | change | /remote.php/dav/spaces/<> | + | change | /dav/spaces/<> | + | read | /remote.php/dav/spaces/<> | + | read | /dav/spaces/<> | + + @issue-7618 + Scenario Outline: move a file from personal to project space + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Brian" has uploaded a file inside space "Personal" with content "some data" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has shared a space "project-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" moves a file "textfile.txt" into "/" inside space "project-space" using file-id path "" + Then the HTTP status code should be "" + And for user "Brian" folder "/" of the space "Personal" should contain these files: + | textfile.txt | + But for user "Brian" folder "/" of the space "project-space" should not contain these files: + | textfile.txt | + Examples: + | role | http-status-code | dav-path | + | manager | 403 | /remote.php/dav/spaces/<> | + | editor | 403 | /remote.php/dav/spaces/<> | + | viewer | 403 | /remote.php/dav/spaces/<> | + | manager | 403 | /dav/spaces/<> | + | editor | 403 | /dav/spaces/<> | + | viewer | 403 | /dav/spaces/<> | + + @issue-7618 + Scenario Outline: move a file to different name from personal space to project space Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "Personal" with content "some data" to "textfile.txt" + And we save it into "FILEID" + When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "project-space" using file-id path "" + Then the HTTP status code should be "403" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "Personal" should contain these files: + | textfile.txt | + But for user "Alice" folder "/" of the space "project-space" should not contain these files: + | renamed.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> | + + + Scenario Outline: move a file into a folder inside project space (manager/editor) + Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created a space "project-space" with the default quota using the Graph API And user "Alice" has created a folder "/folder" in space "project-space" And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" And we save it into "FILEID" - When user "Alice" moves a file "/textfile.txt" into "/folder" inside space "project-space" using file-id path "" + And user "Alice" has shared a space "project-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" moves a file "/textfile.txt" into "/folder" inside space "project-space" using file-id path "" Then the HTTP status code should be "201" And for user "Alice" folder "folder" of the space "project-space" should contain these files: | textfile.txt | But for user "Alice" the space "project-space" should not contain these entries: | textfile.txt | + Examples: + | role | dav-path | + | manager | /remote.php/dav/spaces/<> | + | editor | /remote.php/dav/spaces/<> | + | manager | /dav/spaces/<> | + | editor | /dav/spaces/<> | + + + Scenario Outline: try to move a file into a folder inside project space (viewer) + Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has created a folder "/folder" in space "project-space" + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has shared a space "project-space" with settings: + | shareWith | Brian | + | role | viewer | + When user "Brian" moves a file "/textfile.txt" into "/folder" inside space "project-space" using file-id path "" + Then the HTTP status code should be "403" + And for user "Alice" the space "project-space" should contain these entries: + | textfile.txt | + But for user "Alice" folder "folder" of the space "project-space" should not contain these files: + | textfile.txt | Examples: | dav-path | | /remote.php/dav/spaces/<> | @@ -145,43 +239,193 @@ Feature: moving/renaming file using file id | /remote.php/dav/spaces/<> | | /dav/spaces/<> | + @issue-8116 + Scenario Outline: move a file between two project spaces + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "first-project-space" with the default quota using the Graph API + And user "Alice" has created a space "second-project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "first-project-space" with content "first project space" to "file.txt" + And we save it into "FILEID" + And user "Alice" has shared a space "first-project-space" with settings: + | shareWith | Brian | + | role | | + And user "Alice" has shared a space "second-project-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" moves a file "file.txt" into "/" inside space "second-project-space" using file-id path "" + Then the HTTP status code should be "" + And for user "Brian" the space "second-project-space" should not contain these entries: + | file.txt | + But for user "Brian" the space "first-project-space" should contain these entries: + | file.txt | + Examples: + | from_role | to_role | http-status-code | dav-path | + | manager | manager | 403 | /remote.php/dav/spaces/<> | + | editor | manager | 403 | /remote.php/dav/spaces/<> | + | manager | editor | 403 | /remote.php/dav/spaces/<> | + | editor | editor | 403 | /remote.php/dav/spaces/<> | + | manager | viewer | 403 | /remote.php/dav/spaces/<> | + | editor | viewer | 403 | /remote.php/dav/spaces/<> | + | viewer | manager | 403 | /remote.php/dav/spaces/<> | + | viewer | editor | 403 | /remote.php/dav/spaces/<> | + | viewer | viewer | 403 | /remote.php/dav/spaces/<> | + | manager | manager | 403 | /dav/spaces/<> | + | editor | manager | 403 | /dav/spaces/<> | + | manager | editor | 403 | /dav/spaces/<> | + | editor | editor | 403 | /dav/spaces/<> | + | manager | viewer | 403 | /dav/spaces/<> | + | editor | viewer | 403 | /dav/spaces/<> | + | viewer | manager | 403 | /dav/spaces/<> | + | viewer | editor | 403 | /dav/spaces/<> | + | viewer | viewer | 403 | /dav/spaces/<> | + + @issue-8116 + Scenario Outline: move a file to different name between project spaces + Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "first-project-space" with the default quota using the Graph API + And user "Alice" has created a space "second-project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "first-project-space" with content "data from first project space" to "firstProjectSpacetextfile.txt" + And user "Alice" has uploaded a file inside space "second-project-space" with content "data from second project space" to "secondProjectSpacetextfile.txt" + And we save it into "FILEID" + When user "Alice" renames a file "/secondProjectSpacetextfile.txt" into "/renamedSecondProjectSpacetextfile.txt" inside space "first-project-space" using file-id path "" + Then the HTTP status code should be "403" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "first-project-space" should contain these files: + | firstProjectSpacetextfile.txt | + And for user "Alice" folder "/" of the space "second-project-space" should contain these files: + | secondProjectSpacetextfile.txt | + But for user "Alice" the space "first-project-space" should not contain these entries: + | renamedSecondProjectSpacetextfile.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> | + - Scenario Outline: move a file from sub-folder to root folder inside shares space + Scenario Outline: move a file from project to shares space Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/folder" - And user "Alice" has created folder "folder/sub-folder" - And user "Alice" has uploaded file with content "some data" to "/folder/sub-folder/test.txt" + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" And we save it into "FILEID" - And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" - When user "Brian" moves a file "Shares/folder/sub-folder/test.txt" into "Shares/folder" inside space "Shares" using file-id path "" + And user "Alice" has shared a space "project-space" with settings: + | shareWith | Brian | + | role | | + And user "Alice" has created folder "testshare" + And user "Alice" has shared folder "testshare" with user "Brian" with permissions "" + When user "Brian" moves a file "textfile.txt" into "testshare" inside space "Shares" using file-id path "" Then the HTTP status code should be "403" - And the value of the item "/d:error/s:message" in the response about user "Brian" should be "cross storage moves are not permitted, use copy and delete" + And for user "Brian" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + But for user "Brian" folder "testshare" of the space "Shares" should not contain these files: + | textfile.txt | + Examples: + | role | permissions | dav-path | + | manager | all | /remote.php/dav/spaces/<> | + | editor | all | /remote.php/dav/spaces/<> | + | viewer | all | /remote.php/dav/spaces/<> | + | manager | change | /remote.php/dav/spaces/<> | + | editor | change | /remote.php/dav/spaces/<> | + | viewer | change | /remote.php/dav/spaces/<> | + | manager | read | /remote.php/dav/spaces/<> | + | editor | read | /remote.php/dav/spaces/<> | + | viewer | read | /remote.php/dav/spaces/<> | + | manager | all | /dav/spaces/<> | + | editor | all | /dav/spaces/<> | + | viewer | all | /dav/spaces/<> | + | manager | change | /dav/spaces/<> | + | editor | change | /dav/spaces/<> | + | viewer | change | /dav/spaces/<> | + | manager | read | /dav/spaces/<> | + | editor | read | /dav/spaces/<> | + | viewer | read | /dav/spaces/<> | + + @issue-7618 + Scenario Outline: move a file from project to personal space + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + And we save it into "FILEID" + And user "Alice" has shared a space "project-space" with settings: + | shareWith | Brian | + | role | | + When user "Brian" moves a file "/textfile.txt" into "/" inside space "Personal" using file-id path "" + Then the HTTP status code should be "" + And for user "Brian" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + But for user "Brian" folder "/" of the space "Personal" should not contain these files: + | textfile.txt | + Examples: + | role | http-status-code | dav-path | + | manager | 403 | /remote.php/dav/spaces/<> | + | editor | 403 | /remote.php/dav/spaces/<> | + | viewer | 403 | /remote.php/dav/spaces/<> | + | manager | 403 | /dav/spaces/<> | + | editor | 403 | /dav/spaces/<> | + | viewer | 403 | /dav/spaces/<> | + + @issue-7618 + Scenario Outline: move a file to different name from project space to personal space + Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + And we save it into "FILEID" + When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "Personal" using file-id path "" + Then the HTTP status code should be "403" + And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" + And for user "Alice" folder "/" of the space "project-space" should contain these files: + | textfile.txt | + But for user "Alice" folder "/" of the space "Personal" should not contain these files: + | renamed.txt | + Examples: + | dav-path | + | /remote.php/dav/spaces/<> | + | /dav/spaces/<> | + + @issue-7617 + Scenario Outline: move a file into a folder within a shared folder (all/change permissions) + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "folder" + And user "Alice" has created folder "folder/sub-folder" + And user "Alice" has uploaded file with content "some data" to "folder/test.txt" + And we save it into "FILEID" + And user "Alice" has shared folder "folder" with user "Brian" with permissions "" + When user "Brian" moves a file "Shares/folder/test.txt" into "folder/sub-folder" inside space "Shares" using file-id path "" + Then the HTTP status code should be "201" And for user "Brian" folder "folder/sub-folder" of the space "Shares" should contain these files: | test.txt | - And for user "Brian" folder "folder" of the space "Shares" should not contain these files: - | test.txt | And for user "Alice" folder "folder/sub-folder" of the space "Personal" should contain these files: | test.txt | + But for user "Brian" folder "folder" of the space "Shares" should not contain these files: + | test.txt | And for user "Alice" folder "folder" of the space "Personal" should not contain these files: | test.txt | Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | + | permissions | dav-path | + | all | /remote.php/dav/spaces/<> | + | all | /dav/spaces/<> | + | change | /remote.php/dav/spaces/<> | + | change | /dav/spaces/<> | - Scenario Outline: move a file from personal to share space + Scenario Outline: try to move a file into a folder within a shared folder (read permissions) Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/folder" - And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" - And user "Brian" has uploaded file with content "some data" to "/test.txt" + And user "Alice" has created folder "folder" + And user "Alice" has created folder "folder/sub-folder" + And user "Alice" has uploaded file with content "some data" to "folder/test.txt" And we save it into "FILEID" - When user "Brian" moves a file "/test.txt" into "Shares/folder" inside space "Shares" using file-id path "" + And user "Alice" has shared folder "folder" with user "Brian" with permissions "read" + When user "Brian" moves a file "Shares/folder/test.txt" into "folder/sub-folder" inside space "Shares" using file-id path "" Then the HTTP status code should be "403" - And the value of the item "/d:error/s:message" in the response about user "Brian" should be "cross storage moves are not permitted, use copy and delete" - And for user "Brian" folder "/" of the space "Personal" should contain these files: + And for user "Brian" folder "folder/sub-folder" of the space "Shares" should not contain these files: | test.txt | - But for user "Alice" folder "folder" of the space "Personal" should not contain these files: + And for user "Alice" folder "folder/sub-folder" of the space "Personal" should not contain these files: + | test.txt | + But for user "Brian" folder "folder" of the space "Shares" should contain these files: + | test.txt | + And for user "Alice" folder "folder" of the space "Personal" should contain these files: | test.txt | Examples: | dav-path | @@ -189,45 +433,101 @@ Feature: moving/renaming file using file id | /dav/spaces/<> | + Scenario Outline: move a file from one shared folder to another shared folder + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "testshare1" + And user "Alice" has created folder "testshare2" + And user "Alice" has uploaded file with content "some data" to "testshare1/textfile.txt" + And we save it into "FILEID" + And user "Alice" has shared folder "testshare1" with user "Brian" with permissions "" + And user "Alice" has shared folder "testshare2" with user "Brian" with permissions "" + When user "Brian" moves a file "Shares/testshare1/textfile.txt" into "testshare2" inside space "Shares" using file-id path "" + Then the HTTP status code should be "403" + And for user "Brian" folder "testshare1" of the space "Shares" should contain these files: + | textfile.txt | + But for user "Brian" folder "testshare2" of the space "Shares" should not contain these files: + | textfile.txt | + Examples: + | from_permissions | to_permissions | dav-path | + | all | all | /remote.php/dav/spaces/<> | + | all | change | /remote.php/dav/spaces/<> | + | all | read | /remote.php/dav/spaces/<> | + | change | all | /remote.php/dav/spaces/<> | + | change | change | /remote.php/dav/spaces/<> | + | change | read | /remote.php/dav/spaces/<> | + | read | all | /remote.php/dav/spaces/<> | + | read | change | /remote.php/dav/spaces/<> | + | read | read | /remote.php/dav/spaces/<> | + | all | all | /dav/spaces/<> | + | all | change | /dav/spaces/<> | + | all | read | /dav/spaces/<> | + | change | all | /dav/spaces/<> | + | change | change | /dav/spaces/<> | + | change | read | /dav/spaces/<> | + | read | all | /dav/spaces/<> | + | read | change | /dav/spaces/<> | + | read | read | /dav/spaces/<> | + + @issue-8124 Scenario Outline: move a file from share to personal space Given user "Brian" has been created with default attributes and without skeleton files And user "Alice" has created folder "/folder" And user "Alice" has uploaded file with content "some data" to "/folder/test.txt" And we save it into "FILEID" - And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" + And user "Alice" has shared folder "/folder" with user "Brian" with permissions "" When user "Brian" moves a file "Shares/folder/test.txt" into "/" inside space "Personal" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Brian" should be "move:error: not supported: cannot move across spaces" + Then the HTTP status code should be "" And for user "Brian" folder "folder" of the space "Shares" should contain these files: | test.txt | And for user "Brian" folder "/" of the space "Personal" should not contain these files: | test.txt | Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | - - - Scenario Outline: move a file between two project spaces - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "first-project-space" with the default quota using the Graph API - And user "Alice" has created a space "second-project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "first-project-space" with content "data from first project space" to "firstProjectSpacetextfile.txt" - And user "Alice" has uploaded a file inside space "second-project-space" with content "data from second project space" to "secondProjectSpacetextfile.txt" + | permissions | dav-path | http-status-code | + | all | /remote.php/dav/spaces/<> | 403 | + | all | /dav/spaces/<> | 403 | + | change | /remote.php/dav/spaces/<> | 403 | + | change | /dav/spaces/<> | 403 | + | read | /remote.php/dav/spaces/<> | 403 | + | read | /dav/spaces/<> | 403 | + + @issue-8125 + Scenario Outline: move a file from shares to project space + Given user "Brian" has been created with default attributes and without skeleton files + And the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has shared a space "project-space" with settings: + | shareWith | Brian | + | role | | + And user "Alice" has created folder "testshare" + And user "Alice" has uploaded file with content "some data" to "testshare/textfile.txt" And we save it into "FILEID" - When user "Alice" moves a file "/secondProjectSpacetextfile.txt" into "/" inside space "first-project-space" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" - And for user "Alice" folder "/" of the space "first-project-space" should contain these files: - | firstProjectSpacetextfile.txt | - And for user "Alice" folder "/" of the space "second-project-space" should contain these files: - | secondProjectSpacetextfile.txt | - But for user "Alice" the space "first-project-space" should not contain these entries: - | secondProjectSpacetextfile.txt | + And user "Alice" has shared folder "testshare" with user "Brian" with permissions "" + When user "Brian" moves a file "Shares/testshare/textfile.txt" into "/" inside space "project-space" using file-id path "" + Then the HTTP status code should be "" + And for user "Brian" folder "testshare" of the space "Shares" should contain these files: + | textfile.txt | + But for user "Brian" folder "/" of the space "project-space" should not contain these files: + | textfile.txt | Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | + | role | permissions | http-status-code | dav-path | + | manager | all | 403 | /remote.php/dav/spaces/<> | + | editor | all | 403 | /remote.php/dav/spaces/<> | + | viewer | all | 403 | /remote.php/dav/spaces/<> | + | manager | change | 403 | /remote.php/dav/spaces/<> | + | editor | change | 403 | /remote.php/dav/spaces/<> | + | viewer | change | 403 | /remote.php/dav/spaces/<> | + | manager | read | 403 | /remote.php/dav/spaces/<> | + | editor | read | 403 | /remote.php/dav/spaces/<> | + | viewer | read | 403 | /remote.php/dav/spaces/<> | + | manager | all | 403 | /dav/spaces/<> | + | editor | all | 403 | /dav/spaces/<> | + | viewer | all | 403 | /dav/spaces/<> | + | manager | change | 403 | /dav/spaces/<> | + | editor | change | 403 | /dav/spaces/<> | + | viewer | change | 403 | /dav/spaces/<> | + | manager | read | 403 | /dav/spaces/<> | + | editor | read | 403 | /dav/spaces/<> | + | viewer | read | 403 | /dav/spaces/<> | Scenario Outline: rename a root file inside personal space @@ -278,26 +578,6 @@ Feature: moving/renaming file using file id | /dav/spaces/<> | - Scenario Outline: move a file to a different name into a sub-folder inside share space - Given user "Brian" has been created with default attributes and without skeleton files - And user "Alice" has created folder "/folder" - And user "Alice" has created folder "/folder/sub-folder" - And user "Alice" has uploaded file with content "some data" to "/folder/test.txt" - And we save it into "FILEID" - And user "Alice" has shared folder "/folder" with user "Brian" with permissions "all" - When user "Brian" renames a file "Shares/folder/test.txt" into "Shares/folder/sub-folder/renamed.txt" inside space "Shares" using file-id path "" - Then the HTTP status code should be "403" - And the value of the item "/d:error/s:message" in the response about user "Brian" should be "cross storage moves are not permitted, use copy and delete" - And for user "Brian" folder "folder" of the space "Shares" should contain these files: - | test.txt | - And for user "Brian" folder "folder/sub-folder" of the space "Shares" should not contain these files: - | renamed.txt | - Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | - - Scenario Outline: rename a file and move from a folder to root inside personal space Given user "Alice" has created folder "/folder" And user "Alice" has uploaded file with content "some data" to "folder/textfile.txt" @@ -330,96 +610,42 @@ Feature: moving/renaming file using file id | /remote.php/dav/spaces/<> | | /dav/spaces/<> | - - Scenario Outline: move a file from project to personal space - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" - And we save it into "FILEID" - When user "Alice" moves a file "/textfile.txt" into "/" inside space "Personal" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" - And for user "Alice" folder "/" of the space "project-space" should contain these files: - | textfile.txt | - But for user "Alice" folder "/" of the space "Personal" should not contain these files: - | textfile.txt | - Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | - - - Scenario Outline: move a file from personal to project space - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "Personal" with content "some data" to "textfile.txt" - And we save it into "FILEID" - When user "Alice" moves a file "/textfile.txt" into "/" inside space "project-space" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" - And for user "Alice" folder "/" of the space "Personal" should contain these files: - | textfile.txt | - But for user "Alice" folder "/" of the space "project-space" should not contain these files: - | textfile.txt | - Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | - - - Scenario Outline: move a file to different name from project space to personal space - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "project-space" with content "some data" to "textfile.txt" + @issue-7617 + Scenario Outline: move a file to a different name into a sub-folder inside share space (all/change permissions) + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/folder" + And user "Alice" has created folder "/folder/sub-folder" + And user "Alice" has uploaded file with content "some data" to "/folder/test.txt" And we save it into "FILEID" - When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "Personal" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" - And for user "Alice" folder "/" of the space "project-space" should contain these files: - | textfile.txt | - But for user "Alice" folder "/" of the space "Personal" should not contain these files: + And user "Alice" has shared folder "/folder" with user "Brian" with permissions "" + When user "Brian" renames a file "Shares/folder/test.txt" into "folder/sub-folder/renamed.txt" inside space "Shares" using file-id path "" + Then the HTTP status code should be "201" + And for user "Brian" folder "folder/sub-folder" of the space "Shares" should contain these files: | renamed.txt | + But for user "Brian" folder "folder" of the space "Shares" should not contain these files: + | test.txt | Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | + | permissions | dav-path | + | all | /remote.php/dav/spaces/<> | + | all | /dav/spaces/<> | + | change | /remote.php/dav/spaces/<> | + | change | /dav/spaces/<> | - Scenario Outline: move a file to different name from personal space to project space - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "Personal" with content "some data" to "textfile.txt" + Scenario Outline: move a file to a different name into a sub-folder inside share space (read permissions) + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/folder" + And user "Alice" has created folder "/folder/sub-folder" + And user "Alice" has uploaded file with content "some data" to "/folder/test.txt" And we save it into "FILEID" - When user "Alice" renames a file "/textfile.txt" into "/renamed.txt" inside space "project-space" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" - And for user "Alice" folder "/" of the space "Personal" should contain these files: - | textfile.txt | - But for user "Alice" folder "/" of the space "project-space" should not contain these files: + And user "Alice" has shared folder "/folder" with user "Brian" with permissions "read" + When user "Brian" renames a file "Shares/folder/test.txt" into "folder/sub-folder/renamed.txt" inside space "Shares" using file-id path "" + Then the HTTP status code should be "403" + And for user "Brian" folder "folder" of the space "Shares" should contain these files: + | test.txt | + But for user "Brian" folder "folder/sub-folder" of the space "Shares" should not contain these files: | renamed.txt | Examples: | dav-path | | /remote.php/dav/spaces/<> | | /dav/spaces/<> | - - - Scenario Outline: move a file to different name between project spaces - Given the administrator has assigned the role "Space Admin" to user "Alice" using the Graph API - And user "Alice" has created a space "first-project-space" with the default quota using the Graph API - And user "Alice" has created a space "second-project-space" with the default quota using the Graph API - And user "Alice" has uploaded a file inside space "first-project-space" with content "data from first project space" to "firstProjectSpacetextfile.txt" - And user "Alice" has uploaded a file inside space "second-project-space" with content "data from second project space" to "secondProjectSpacetextfile.txt" - And we save it into "FILEID" - When user "Alice" renames a file "/secondProjectSpacetextfile.txt" into "/renamedSecondProjectSpacetextfile.txt" inside space "first-project-space" using file-id path "" - Then the HTTP status code should be "502" - And the value of the item "/d:error/s:message" in the response about user "Alice" should be "move:error: not supported: cannot move across spaces" - And for user "Alice" folder "/" of the space "first-project-space" should contain these files: - | firstProjectSpacetextfile.txt | - And for user "Alice" folder "/" of the space "second-project-space" should contain these files: - | secondProjectSpacetextfile.txt | - But for user "Alice" the space "first-project-space" should not contain these entries: - | renamedSecondProjectSpacetextfile.txt | - Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | diff --git a/tests/acceptance/features/apiSpacesShares/moveSpaces.feature b/tests/acceptance/features/apiSpacesShares/moveSpaces.feature index 2615c1978a3..8800ed320cd 100644 --- a/tests/acceptance/features/apiSpacesShares/moveSpaces.feature +++ b/tests/acceptance/features/apiSpacesShares/moveSpaces.feature @@ -46,7 +46,7 @@ Feature: move (rename) file But for user "Alice" the space "Project" should contain these entries: | insideSpace.txt | - + @issue-8116 Scenario Outline: user moves a file from a space project with different a role to a space project with different role Given the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API And user "Brian" has created a space "Project1" with the default quota using the Graph API @@ -59,24 +59,24 @@ Feature: move (rename) file | shareWith | Alice | | role | | When user "Alice" moves file "project1.txt" from space "Project1" to "project1.txt" inside space "Project2" using the WebDAV API - Then the HTTP status code should be "" + Then the HTTP status code should be "" And for user "Alice" the space "Project1" should contain these entries: | project1.txt | And for user "Alice" the space "Project2" should not contain these entries: | project1.txt | Examples: - | from_role | to_role | https_status_code | - | manager | manager | 502 | - | editor | manager | 502 | - | manager | editor | 502 | - | editor | editor | 502 | + | from_role | to_role | http-status-code | + | manager | manager | 403 | + | editor | manager | 403 | + | manager | editor | 403 | + | editor | editor | 403 | | manager | viewer | 403 | | editor | viewer | 403 | | viewer | manager | 403 | | viewer | editor | 403 | | viewer | viewer | 403 | - + @issue-7618 Scenario Outline: user moves a file from a space project with different role to a space personal Given the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API And user "Brian" has created a space "Project" with the default quota using the Graph API @@ -85,15 +85,15 @@ Feature: move (rename) file | shareWith | Alice | | role | | When user "Alice" moves file "project.txt" from space "Project" to "project.txt" inside space "Personal" using the WebDAV API - Then the HTTP status code should be "" + Then the HTTP status code should be "" And for user "Alice" the space "Project" should contain these entries: | project.txt | And for user "Alice" the space "Personal" should not contain these entries: | project.txt | Examples: - | role | https_status_code | - | manager | 502 | - | editor | 502 | + | role | http-status-code | + | manager | 403 | + | editor | 403 | | viewer | 403 | @@ -114,17 +114,17 @@ Feature: move (rename) file | project.txt | Examples: | role | permissions | - | manager | 31 | - | editor | 31 | - | viewer | 31 | - | manager | 17 | - | editor | 17 | - | viewer | 17 | - | manager | 1 | - | editor | 1 | - | viewer | 1 | - + | manager | all | + | editor | all | + | viewer | all | + | manager | change | + | editor | change | + | viewer | change | + | manager | read | + | editor | read | + | viewer | read | + @issue-7618 Scenario Outline: user moves a file from space personal to space project with different role Given the administrator has assigned the role "Space Admin" to user "Brian" using the Graph API And user "Brian" has created a space "Project" with the default quota using the Graph API @@ -133,15 +133,15 @@ Feature: move (rename) file | role | | And user "Alice" has uploaded file with content "personal space content" to "/personal.txt" When user "Alice" moves file "personal.txt" from space "Personal" to "personal.txt" inside space "Project" using the WebDAV API - Then the HTTP status code should be "" + Then the HTTP status code should be "" And for user "Alice" the space "Personal" should contain these entries: | personal.txt | And for user "Alice" the space "Project" should not contain these entries: | personal.txt | Examples: - | role | https_status_code | - | manager | 502 | - | editor | 502 | + | role | http-status-code | + | manager | 403 | + | editor | 403 | | viewer | 403 | @@ -157,9 +157,9 @@ Feature: move (rename) file | project.txt | Examples: | permissions | - | 31 | - | 17 | - | 1 | + | all | + | change | + | read | Scenario Outline: user moves a file from space Shares with different role (permissions) to space personal @@ -174,9 +174,9 @@ Feature: move (rename) file | testshare.txt | Examples: | permissions | - | 31 | - | 17 | - | 1 | + | all | + | change | + | read | Scenario Outline: user moves a file from space Shares with different role (permissions) to space project with different role @@ -196,15 +196,15 @@ Feature: move (rename) file | testshare.txt | Examples: | role | permissions | - | manager | 31 | - | editor | 31 | - | viewer | 31 | - | manager | 17 | - | editor | 17 | - | viewer | 17 | - | manager | 1 | - | editor | 1 | - | viewer | 1 | + | manager | all | + | editor | all | + | viewer | all | + | manager | change | + | editor | change | + | viewer | change | + | manager | read | + | editor | read | + | viewer | read | Scenario Outline: user moves a file from space Shares to another space Shares with different role (permissions) @@ -221,15 +221,15 @@ Feature: move (rename) file | testshare1.txt | Examples: | from_permissions | to_permissions | - | 31 | 31 | - | 31 | 17 | - | 31 | 1 | - | 17 | 31 | - | 17 | 17 | - | 17 | 1 | - | 1 | 31 | - | 1 | 17 | - | 1 | 1 | + | all | all | + | all | change | + | all | read | + | change | all | + | change | change | + | change | read | + | read | all | + | read | change | + | read | read | Scenario Outline: moving a file out of a shared folder as a sharer @@ -245,9 +245,9 @@ Feature: move (rename) file | testfile.txt | Examples: | permissions | - | 31 | - | 17 | - | 1 | + | all | + | change | + | read | Scenario Outline: moving a folder out of a shared folder as a sharer @@ -266,9 +266,9 @@ Feature: move (rename) file | testsubfolder | Examples: | permissions | - | 31 | - | 17 | - | 1 | + | all | + | change | + | read | Scenario Outline: sharee moves a file within a Shares space (all/change permissions) diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 80fcb4b6ae1..f4672f18780 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -1980,16 +1980,19 @@ public function copyFilesAndFoldersRequest(string $user, string $fullUrl, array */ public function userCopiesOrMovesFileWithFileIdFromAndToSpaceBetweenSpaces(string $user, string $actionType, string $sourceFile, string $destinationFile, string $toSpaceName, string $url): void { // split the source when there are sub-folders - $sourceFile = explode("/", $sourceFile); + $sourceFile = \trim($sourceFile, "/"); + $sourceFile = \explode("/", $sourceFile); + $sourceFile = \end($sourceFile); + $destinationFile = \trim($destinationFile, "/"); $fileDestination = ''; if ($actionType === 'copies' || $actionType === 'moves') { - $fileDestination = $this->escapePath(\ltrim($destinationFile, "/")) . '/' . $this->escapePath(\ltrim(end($sourceFile), "/")); + $fileDestination = $this->escapePath($destinationFile) . '/' . $this->escapePath($sourceFile); } elseif ($actionType === 'renames') { $fileDestination = $destinationFile; } $baseUrl = $this->featureContext->getBaseUrl(); if ($toSpaceName === 'Shares') { - $sharesPath = $this->featureContext->getMountSharesPath($user, $fileDestination); + $sharesPath = $this->featureContext->getSharesMountPath($user, $fileDestination); $davPath = WebDavHelper::getDavPath($user, $this->featureContext->getDavPathVersion()); $headers['Destination'] = $baseUrl . $davPath . $sharesPath; } else { diff --git a/tests/acceptance/features/bootstrap/WebDav.php b/tests/acceptance/features/bootstrap/WebDav.php index 50efea1028b..0609bfe0aa0 100644 --- a/tests/acceptance/features/bootstrap/WebDav.php +++ b/tests/acceptance/features/bootstrap/WebDav.php @@ -4946,29 +4946,27 @@ public function userUploadsFileWithContentSharedResourceToUsingTheWebdavApi(stri * @return string * @throws GuzzleException */ - public function getMountSharesPath( + public function getSharesMountPath( string $user, string $path ): string { $user = $this->getActualUsername($user); $path = trim($path, "/"); $pathArray = explode("/", $path); + $sharedFolder = $pathArray[0] === "Shares" ? $pathArray[1] : $pathArray[0]; $shareMountId = GraphHelper::getShareMountId( $this->getBaseUrl(), $this->getStepLineRef(), $user, $this->getPasswordForUser($user), - $pathArray[1] + $sharedFolder ); - if (\count($pathArray) > 2) { - $pathArray = \array_slice($pathArray, 2); - $path = '/' . implode("/", array_map("strval", $pathArray)); - } else { - $path = null; - } - return $shareMountId . $path; + $path = \array_slice($pathArray, array_search($sharedFolder, $pathArray) + 1); + $path = \implode("/", $path); + + return "$shareMountId/$path"; } /** @@ -4997,7 +4995,7 @@ public function downloadSharedFilePreview( } else { $urlParameter = null; } - $sharesPath = $this->getMountSharesPath($user, $path) . '/?' . $urlParameter; + $sharesPath = $this->getSharesMountPath($user, $path) . '/?' . $urlParameter; $davPath = WebDavHelper::getDavPath($user, $this->getDavPathVersion()); $fullUrl = $this->getBaseUrl() . $davPath . $sharesPath; @@ -5024,7 +5022,7 @@ public function uploadToSharedFolder( string $destination, ?string $content = null ): ResponseInterface { - $sharesPath = $this->getMountSharesPath($user, $destination); + $sharesPath = $this->getSharesMountPath($user, $destination); $davPath = WebDavHelper::getDavPath($user, $this->getDavPathVersion()); $fullUrl = $this->getBaseUrl() . $davPath . $sharesPath;