Files
opencloud/tests/acceptance/features/coreApiWebdavMove/moveShareOnOpencloud.feature
T
Jörn Friedrich Dreyer e38ca9600c test: align acceptance tests with the bumped reva
The reva bump pulls in three backports that change what the acceptance
tests see:

- moving now also requires the delete permission, so a sharee with the
  Uploader role gets a 403 when moving inside a share
- oc:permissions only contains NV when the user can move, so a file
  shared as File Editor now reports SW instead of SNVW
- shares listed in the share jail root report the share jail root as
  their parent id, so propfindShares.feature:149 passes now

The Uploader rows move from the "can move" outlines to the "cannot
move" outlines. This shifts one scenario in moveSpaces.feature by three
lines, the expected failures lists are updated accordingly.

related: https://github.com/opencloud-eu/reva/pull/1020
related: https://github.com/opencloud-eu/reva/pull/1023
related: https://github.com/opencloud-eu/reva/pull/1024

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2026-11-18 11:01:11 +01:00

341 lines
17 KiB
Gherkin

@skipOnReva
Feature: move (rename) file
As a user
I want to be able to move and rename files
So that I can manage my file system
Background:
Given using OCS API version "1"
And user "Alice" has been created with default attributes
Scenario Outline: sharer moves a file into a shared folder
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/testshare"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
And user "Brian" has uploaded file with content "test data" to "/testfile.txt"
When user "Brian" moves file "/testfile.txt" to "testshare/testfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/Shares/testshare/testfile.txt" for user "Alice" should be "test data"
And the content of file "/testshare/testfile.txt" for user "Brian" should be "test data"
And as "Brian" file "/testfile.txt" should not exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: sharee tries to move a file into a shared folder
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/testshare"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
And user "Alice" has uploaded file with content "test data" to "/testfile.txt"
When user "Alice" moves file "/testfile.txt" to "Shares/testshare/testfile.txt" using the WebDAV API
Then the HTTP status code should be "502"
And as "Alice" file "Shares/testshare/testfile.txt" should not exist
And as "Brian" file "testshare/testfile.txt" should not exist
But as "Alice" file "/testfile.txt" should exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: moving a file out of a shared folder as the sharer
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/testshare"
And user "Brian" has uploaded file with content "test data" to "/testshare/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Brian" moves file "/testshare/testfile.txt" to "/testfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/testfile.txt" for user "Brian" should be "test data"
And as "Alice" file "/Shares/testshare/testfile.txt" should not exist
And as "Brian" file "/testshare/testfile.txt" should not exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: moving a file out of a shared folder as the sharee
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/testshare"
And user "Brian" has uploaded file with content "test data" to "/testshare/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Alice" moves file "/Shares/testshare/testfile.txt" to "/testfile.txt" using the WebDAV API
Then the HTTP status code should be "502"
And as "Alice" file "/Shares/testshare/testfile.txt" should exist
And as "Brian" file "/testshare/testfile.txt" should exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: moving a folder into a shared folder the sharer
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/testshare"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
And user "Brian" has created folder "/testsubfolder"
And user "Brian" has uploaded file with content "test data" to "/testsubfolder/testfile.txt"
When user "Brian" moves folder "/testsubfolder" to "testshare/testsubfolder" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/Shares/testshare/testsubfolder/testfile.txt" for user "Alice" should be "test data"
And the content of file "/testshare/testsubfolder/testfile.txt" for user "Brian" should be "test data"
And as "Brian" file "/testsubfolder" should not exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: moving a folder into a shared folder as the sharee
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "/testshare"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
And user "Alice" has created folder "/testsubfolder"
And user "Alice" has uploaded file with content "test data" to "/testsubfolder/testfile.txt"
When user "Alice" moves folder "/testsubfolder" to "Shares/testshare/testsubfolder" using the WebDAV API
Then the HTTP status code should be "502"
And as "Alice" folder "/Shares/testshare/testsubfolder" should not exist
And as "Brian" folder "/testshare/testsubfolder" should not exist
But as "Alice" folder "/testsubfolder" should exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: moving a folder out of a shared folder as the sharer
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created the following folders
| path |
| /testshare |
| /testshare/testsubfolder |
And user "Brian" has uploaded file with content "test data" to "/testshare/testsubfolder/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Brian" moves folder "/testshare/testsubfolder" to "/testsubfolder" using the WebDAV API
Then the HTTP status code should be "201"
And the content of file "/testsubfolder/testfile.txt" for user "Brian" should be "test data"
And as "Alice" folder "/testshare/testsubfolder" should not exist
And as "Brian" folder "/testshare/testsubfolder" should not exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: moving a folder out of a shared folder as the sharee
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created the following folders
| path |
| /testshare |
| /testshare/testsubfolder |
And user "Brian" has uploaded file with content "test data" to "/testshare/testsubfolder/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Alice" moves folder "/Shares/testshare/testsubfolder" to "/testsubfolder" using the WebDAV API
Then the HTTP status code should be "502"
And as "Alice" folder "/Shares/testshare/testsubfolder" should exist
And as "Brian" folder "/testshare/testsubfolder" should exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |
Scenario Outline: sharee moves a file within a shared folder (Editor permissions)
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "testshare"
And user "Brian" has created folder "testshare/child"
And user "Brian" has uploaded file with content "test data" to "testshare/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Alice" moves folder "Shares/testshare/testfile.txt" to "Shares/testshare/child/testfile.txt" using the WebDAV API
Then the HTTP status code should be "201"
And as "Alice" file "/Shares/testshare/child/testfile.txt" should exist
And as "Brian" file "/testshare/child/testfile.txt" should exist
And as "Alice" file "/Shares/testshare/testfile.txt" should not exist
And as "Brian" file "/testshare/testfile.txt" should not exist
Examples:
| dav-path-version | permissions-role |
| old | Editor |
| new | Editor |
| spaces | Editor |
Scenario Outline: sharee tries to move a file within a shared folder (Viewer/Uploader permissions)
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "testshare"
And user "Brian" has created folder "testshare/child"
And user "Brian" has uploaded file with content "test data" to "testshare/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Alice" moves folder "Shares/testshare/testfile.txt" to "Shares/testshare/child/testfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Alice" file "/Shares/testshare/child/testfile.txt" should not exist
And as "Brian" file "/testshare/child/testfile.txt" should not exist
And as "Alice" file "/Shares/testshare/testfile.txt" should exist
And as "Brian" file "/testshare/testfile.txt" should exist
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| new | Viewer |
| spaces | Viewer |
| old | Uploader |
| new | Uploader |
| spaces | Uploader |
@issue-1976
Scenario Outline: sharee tries to move a file into same shared folder with same name
Given using <dav-path-version> DAV path
And user "Brian" has been created with default attributes
And user "Brian" has created folder "testshare"
And user "Brian" has uploaded file with content "test data" to "testshare/testfile.txt"
And user "Brian" has sent the following resource share invitation:
| resource | testshare |
| space | Personal |
| sharee | Alice |
| shareType | user |
| permissionsRole | <permissions-role> |
And user "Alice" has a share "testshare" synced
When user "Alice" moves folder "Shares/testshare/testfile.txt" to "Shares/testshare/testfile.txt" using the WebDAV API
Then the HTTP status code should be "403"
And as "Brian" the file with original path "testshare/testfile.txt" should not exist in the trashbin
And the content of file "Shares/testshare/testfile.txt" for user "Alice" should be "test data"
And the content of file "testshare/testfile.txt" for user "Brian" should be "test data"
Examples:
| dav-path-version | permissions-role |
| old | Viewer |
| old | Uploader |
| old | Editor |
| new | Viewer |
| new | Uploader |
| new | Editor |
| spaces | Viewer |
| spaces | Uploader |
| spaces | Editor |