diff --git a/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature b/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature index 581aee7ad2..e4ee6407e3 100644 --- a/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature +++ b/tests/acceptance/features/apiSpacesDavOperation/copyByFileId.feature @@ -242,11 +242,11 @@ Feature: copying file using file id And user "Alice" has uploaded file with content "some data" to "/folder/test.txt" And we save it into "FILEID" And user "Alice" has sent the following resource share invitation: - | resource | folder | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | Editor | + | resource | folder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | And user "Brian" has a share "folder" synced When user "Brian" copies a file "/test.txt" into "/" inside space "Personal" using file-id path "" Then the HTTP status code should be "201" @@ -257,9 +257,13 @@ Feature: copying file using file id And for user "Alice" folder "folder" of the space "Personal" should contain these files: | test.txt | Examples: - | dav-path | - | /remote.php/dav/spaces/<> | - | /dav/spaces/<> | + | permission-role | dav-path | + | Editor | /remote.php/dav/spaces/<> | + | Viewer | /remote.php/dav/spaces/<> | + | Uploader | /remote.php/dav/spaces/<> | + | Editor | /dav/spaces/<> | + | Viewer | /dav/spaces/<> | + | Uploader | /dav/spaces/<> | Scenario Outline: copy a file between two project spaces @@ -280,3 +284,213 @@ Feature: copying file using file id | dav-path | | /remote.php/dav/spaces/<> | | /dav/spaces/<> | + + + Scenario Outline: sharee tries to copy a file from shares space with secure viewer 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 sent the following resource share invitation: + | resource | folder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | Secure viewer | + And user "Brian" has a share "folder" synced + When user "Brian" copies a file "/test.txt" into "/" inside space "Personal" 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 | + 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: sharee copies 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 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 sent the following resource share invitation: + | resource | folder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "folder" synced + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has sent the following space share invitation: + | space | project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + When user "Brian" copies a file "Shares/folder/test.txt" into "/" inside space "project-space" using file-id path "" + Then the HTTP status code should be "201" + And for user "Brian" folder "folder" of the space "Shares" should contain these files: + | test.txt | + And for user "Brian" folder "/" of the space "project-space" should contain these files: + | test.txt | + And for user "Alice" folder "/" of the space "project-space" should contain these files: + | test.txt | + Examples: + | permission-role | space-role | dav-path | + | Viewer | Manager | /remote.php/dav/spaces/<> | + | Viewer | Space Editor | /remote.php/dav/spaces/<> | + | Editor | Manager | /remote.php/dav/spaces/<> | + | Editor | Space Editor | /remote.php/dav/spaces/<> | + | Uploader | Manager | /remote.php/dav/spaces/<> | + | Uploader | Space Editor | /remote.php/dav/spaces/<> | + | Viewer | Manager | /dav/spaces/<> | + | Viewer | Space Editor | /dav/spaces/<> | + | Editor | Manager | /dav/spaces/<> | + | Editor | Space Editor | /dav/spaces/<> | + | Uploader | Manager | /dav/spaces/<> | + | Uploader | Space Editor | /dav/spaces/<> | + + + Scenario Outline: sharee tries to copy 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 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 sent the following resource share invitation: + | resource | folder | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "folder" synced + And user "Alice" has created a space "project-space" with the default quota using the Graph API + And user "Alice" has sent the following space share invitation: + | space | project-space | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + When user "Brian" copies a file "Shares/folder/test.txt" into "/" inside space "project-space" 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 | + And for user "Brian" folder "/" of the space "project-space" should not contain these files: + | test.txt | + And for user "Alice" folder "/" of the space "project-space" should not contain these files: + | test.txt | + Examples: + | permission-role | space-role | dav-path | + | Secure viewer | Manager | /remote.php/dav/spaces/<> | + | Secure viewer | Space Viewer | /remote.php/dav/spaces/<> | + | Secure viewer | Space Editor | /remote.php/dav/spaces/<> | + | Editor | Space Viewer | /remote.php/dav/spaces/<> | + | Viewer | Space Viewer | /remote.php/dav/spaces/<> | + | Uploader | Space Viewer | /remote.php/dav/spaces/<> | + | Secure viewer | Manager | /dav/spaces/<> | + | Secure viewer | Space Viewer | /dav/spaces/<> | + | Secure viewer | Space Editor | /dav/spaces/<> | + | Editor | Space Viewer | /dav/spaces/<> | + | Viewer | Space Viewer | /dav/spaces/<> | + | Uploader | Space Viewer | /dav/spaces/<> | + + + Scenario Outline: sharee copies a file between shares spaces + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/share1" + And user "Alice" has created folder "/share2" + And user "Alice" has uploaded file with content "some data" to "/share1/test.txt" + And we save it into "FILEID" + And user "Alice" has sent the following resource share invitation: + | resource | share1 | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "share1" synced + And user "Alice" has sent the following resource share invitation: + | resource | share2 | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "share2" synced + When user "Brian" copies a file "Shares/share1/test.txt" into "share2" inside space "Shares" using file-id path "" + Then the HTTP status code should be "201" + And for user "Brian" folder "share1" of the space "Shares" should contain these files: + | test.txt | + And for user "Brian" folder "share2" of the space "Shares" should contain these files: + | test.txt | + And for user "Alice" folder "share1" of the space "Personal" should contain these files: + | test.txt | + And for user "Alice" folder "share2" of the space "Personal" should contain these files: + | test.txt | + Examples: + | from-share-role | to-share-role | dav-path | + | Viewer | Editor | /remote.php/dav/spaces/<> | + | Viewer | Uploader | /remote.php/dav/spaces/<> | + | Editor | Editor | /remote.php/dav/spaces/<> | + | Editor | Uploader | /remote.php/dav/spaces/<> | + | Uploader | Editor | /remote.php/dav/spaces/<> | + | Uploader | Uploader | /remote.php/dav/spaces/<> | + | Viewer | Editor | /dav/spaces/<> | + | Viewer | Uploader | /dav/spaces/<> | + | Editor | Editor | /dav/spaces/<> | + | Editor | Uploader | /dav/spaces/<> | + | Uploader | Editor | /dav/spaces/<> | + | Uploader | Uploader | /dav/spaces/<> | + + + Scenario Outline: sharee tries to copy a file between shares space + Given user "Brian" has been created with default attributes and without skeleton files + And user "Alice" has created folder "/share1" + And user "Alice" has created folder "/share2" + And user "Alice" has uploaded file with content "some data" to "/share1/test.txt" + And we save it into "FILEID" + And user "Alice" has sent the following resource share invitation: + | resource | share1 | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "share1" synced + And user "Alice" has sent the following resource share invitation: + | resource | share2 | + | space | Personal | + | sharee | Brian | + | shareType | user | + | permissionsRole | | + And user "Brian" has a share "share2" synced + When user "Brian" copies a file "Shares/share1/test.txt" into "share2" inside space "Shares" using file-id path "" + Then the HTTP status code should be "403" + And for user "Brian" folder "share1" of the space "Shares" should contain these files: + | test.txt | + And for user "Brian" folder "share2" of the space "Shares" should not contain these files: + | test.txt | + And for user "Alice" folder "share1" of the space "Personal" should contain these files: + | test.txt | + And for user "Alice" folder "share2" of the space "Personal" should not contain these files: + | test.txt | + Examples: + | from-share-role | to-share-role | dav-path | + | Secure viewer | Viewer | /remote.php/dav/spaces/<> | + | Secure viewer | Editor | /remote.php/dav/spaces/<> | + | Secure viewer | Uploader | /remote.php/dav/spaces/<> | + | Secure viewer | Secure viewer | /remote.php/dav/spaces/<> | + | Viewer | Viewer | /remote.php/dav/spaces/<> | + | Editor | Viewer | /remote.php/dav/spaces/<> | + | Uploader | Viewer | /remote.php/dav/spaces/<> | + | Viewer | Secure viewer | /remote.php/dav/spaces/<> | + | Editor | Secure viewer | /remote.php/dav/spaces/<> | + | Uploader | Secure viewer | /remote.php/dav/spaces/<> | + | Secure viewer | Viewer | /dav/spaces/<> | + | Secure viewer | Editor | /dav/spaces/<> | + | Secure viewer | Uploader | /dav/spaces/<> | + | Secure viewer | Secure viewer | /dav/spaces/<> | + | Viewer | Viewer | /dav/spaces/<> | + | Editor | Viewer | /dav/spaces/<> | + | Uploader | Viewer | /dav/spaces/<> | + | Viewer | Secure viewer | /dav/spaces/<> | + | Editor | Secure viewer | /dav/spaces/<> | + | Uploader | Secure viewer | /dav/spaces/<> |