2022-07-21 17:42:39 +02:00
Feature: Share spaces via link
2022-12-16 10:08:03 +05:45
As the manager of a space
I want to be able to share a space via public link
2023-04-20 15:30:13 +05:45
So that an anonymous user can have access to certain resources
2022-07-21 17:42:39 +02:00
2022-12-16 10:08:03 +05:45
Background:
2024-11-29 09:39:21 +05:45
Given these users have been created with default attributes:
2022-12-16 10:08:03 +05:45
| username |
| Alice |
| Brian |
And using spaces DAV path
2023-06-15 15:56:48 +02:00
And the administrator has assigned the role " Space Admin " to user " Alice " using the Graph API
2023-10-30 17:57:42 +05:45
And user " Alice " has created a space " share space " with the default quota using the Graph API
2022-12-16 10:08:03 +05:45
And user " Alice " has uploaded a file inside space " share space " with content " some content " to " test.txt "
2022-07-21 17:42:39 +02:00
2025-09-19 17:19:34 +02:00
2023-04-17 17:05:12 +05:45
Scenario Outline: manager can share a space to public via link with different permissions
2022-12-16 10:08:03 +05:45
When user " Alice " creates a public link share of the space " share space " with settings:
| permissions | <permissions> |
| password | <password> |
2024-03-21 09:14:50 +05:45
| name | <link-name> |
| expireDate | <expire-date> |
2022-12-16 10:08:03 +05:45
Then the HTTP status code should be " 200 "
And the OCS status code should be " 200 "
And the OCS status message should be " OK "
And the fields of the last response to user " Alice " should include
2024-03-21 09:14:50 +05:45
| item_type | folder |
| mimetype | httpd/unix-directory |
| file_target | / |
| path | / |
| permissions | <expected-permissions> |
| share_type | public_link |
| displayname_owner | %displayname% |
| uid_owner | %username% |
| name | <link-name> |
2024-11-11 14:28:23 +05:45
When the public downloads file " /test.txt " from inside the last public link shared folder with password " <password> " using the public WebDAV API
2023-10-13 16:59:43 +05:45
Then the HTTP status code should be " 200 "
2022-12-16 10:08:03 +05:45
And the downloaded content should be " some content "
2024-11-11 14:28:23 +05:45
But the public should not be able to download file " /test.txt " from inside the last public link shared folder using the public WebDAV API with password " wrong pass "
2022-12-16 10:08:03 +05:45
Examples:
2024-03-21 09:14:50 +05:45
| permissions | expected-permissions | password | link-name | expire-date |
| 1 | read | %public% | link | 2042-03-25T23:59:59+0100 |
| 5 | read,create | %public% | | 2042-03-25T23:59:59+0100 |
| 15 | read,update,create,delete | %public% | link | |
2023-11-13 23:37:12 +01:00
Scenario: manager can create internal link without password
When user " Alice " creates a public link share of the space " share space " with settings:
| permissions | 0 |
Then the HTTP status code should be " 200 "
And the OCS status code should be " 200 "
And the OCS status message should be " OK "
And the fields of the last response to user " Alice " should include
| permissions | 0 |
| share_type | public_link |
2022-07-21 17:42:39 +02:00
2025-09-19 17:19:34 +02:00
2023-04-17 17:05:12 +05:45
Scenario: uploader should be able to upload a file
2022-12-16 10:08:03 +05:45
When user " Alice " creates a public link share of the space " share space " with settings:
| permissions | 4 |
2023-11-13 23:37:12 +01:00
| password | %public% |
2022-12-16 10:08:03 +05:45
| name | forUpload |
| expireDate | 2042-03-25T23:59:59+0100 |
Then the HTTP status code should be " 200 "
And the OCS status code should be " 200 "
And the OCS status message should be " OK "
And the fields of the last response to user " Alice " should include
| item_type | folder |
| mimetype | httpd/unix-directory |
| file_target | / |
| path | / |
| permissions | create |
| share_type | public_link |
| displayname_owner | %displayname% |
| uid_owner | %username% |
| name | forUpload |
2024-11-11 14:28:23 +05:45
And the public should be able to upload file " lorem.txt " into the last public link shared folder using the public WebDAV API with password " %public% "
2022-12-16 10:08:03 +05:45
And for user " Alice " the space " share space " should contain these entries:
| lorem.txt |
2022-07-21 17:42:39 +02:00
2024-06-24 12:54:57 +05:45
2023-04-17 17:05:12 +05:45
Scenario Outline: user without manager role cannot share a space to public via link
2024-05-10 15:13:57 +05:45
Given user " Alice " has sent the following space share invitation:
| space | share space |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
2022-12-16 10:08:03 +05:45
When user " Brian " creates a public link share of the space " share space " with settings:
| permissions | 1 |
2023-07-31 12:21:47 +05:45
Then the HTTP status code should be " 403 "
And the OCS status code should be " 403 "
2022-12-16 10:08:03 +05:45
And the OCS status message should be " No share permission "
And for user " Alice " the space " share space " should not contain the last created public link
Examples:
2024-05-10 15:13:57 +05:45
| space-role |
| Space Viewer |
| Space Editor |
2022-07-26 11:27:28 +02:00
2023-04-17 17:05:12 +05:45
Scenario: user with manager role can share a space to public via link
2024-05-10 15:13:57 +05:45
Given user " Alice " has sent the following space share invitation:
| space | share space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Manager |
2022-12-16 10:08:03 +05:45
When user " Brian " creates a public link share of the space " share space " with settings:
2023-11-13 23:37:12 +01:00
| permissions | 1 |
| password | %public% |
2022-12-16 10:08:03 +05:45
Then the HTTP status code should be " 200 "
And the OCS status code should be " 200 "
And for user " Alice " the space " share space " should contain the last created public link
2022-11-14 14:02:30 +05:45
2023-04-17 17:05:12 +05:45
Scenario: user cannot share a disabled space to public via link
2022-12-16 10:08:03 +05:45
Given user " Alice " has disabled a space " share space "
When user " Alice " creates a public link share of the space " share space " with settings:
2023-11-13 23:37:12 +01:00
| permissions | 1 |
| password | %public% |
2022-12-16 10:08:03 +05:45
Then the HTTP status code should be " 404 "
And the OCS status code should be " 404 "
And the OCS status message should be " Wrong path, file/folder doesn't exist "
And for user " Alice " the space " share space " should not contain the last created public link
2023-05-12 10:23:20 +02:00
Scenario: user cannot create a public link from the personal space
When user " Alice " creates a public link share of the space " Alice Hansen " with settings:
2023-11-13 23:37:12 +01:00
| permissions | 1 |
| password | %public% |
2023-05-12 10:23:20 +02:00
Then the HTTP status code should be " 400 "
And the OCS status message should be " Can not share space root "
And for user " Alice " the space " Alice Hansen " should not contain the last created public link
2023-12-02 08:24:56 +05:45
2023-12-06 17:00:47 +05:45
Scenario Outline: space admin removes password of a public link share of a space (read/invite permission)
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has created the following space link share:
| space | share space |
2025-01-21 11:54:57 +05:45
| permissionsRole | View |
2024-05-10 15:13:57 +05:45
| password | %public% |
2023-12-02 08:24:56 +05:45
When user " Alice " updates the last public link share using the sharing API with
2024-05-10 15:13:57 +05:45
| permissions | 1 |
| password | |
2023-12-02 08:24:56 +05:45
Then the HTTP status code should be " 200 "
2024-03-21 09:14:50 +05:45
And the OCS status code should be " <ocs-status-code> "
2023-12-06 17:00:47 +05:45
And the OCS status message should be " OK "
Examples:
2024-05-10 15:13:57 +05:45
| ocs-api-version | ocs-status-code |
| 1 | 100 |
| 2 | 200 |
2023-12-02 08:24:56 +05:45
Scenario Outline: space admin tries to remove password of a public link share of a space (various permission)
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has created the following space link share:
| space | share space |
| permissionsRole | <permissions-role> |
| password | %public% |
2023-12-02 08:24:56 +05:45
When user " Alice " updates the last public link share using the sharing API with
| permissions | <permissions> |
| password | |
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
2023-12-02 08:24:56 +05:45
And the OCS status code should be " 400 "
And the OCS status message should be " missing required password "
Examples:
2024-05-10 15:13:57 +05:45
| ocs-api-version | permissions | http-status-code | permissions-role |
2025-01-21 11:54:57 +05:45
| 1 | 5 | 200 | Upload |
| 2 | 5 | 400 | Upload |
| 1 | 15 | 200 | Edit |
| 2 | 15 | 400 | Edit |
| 1 | 4 | 200 | File Drop |
| 2 | 4 | 400 | File Drop |
2023-12-02 08:24:56 +05:45
2023-12-06 17:00:47 +05:45
Scenario Outline: space admin removes password of a public link share of a space (invite permission)
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has created the following space link share:
| space | share space |
2025-01-21 11:54:57 +05:45
| permissionsRole | View |
2024-05-10 15:13:57 +05:45
| password | %public% |
2023-12-06 17:00:47 +05:45
When user " Alice " updates the last public link share using the sharing API with
| permissions | 0 |
| password | |
Then the HTTP status code should be " 200 "
2024-03-21 09:14:50 +05:45
And the OCS status code should be " <ocs-status-code> "
2023-12-06 17:00:47 +05:45
And the OCS status message should be " OK "
Examples:
2024-03-21 09:14:50 +05:45
| ocs-api-version | ocs-status-code |
2023-12-06 17:00:47 +05:45
| 1 | 100 |
| 2 | 200 |
2023-12-07 12:11:26 +05:45
Scenario Outline: space manager tries to remove password of a public link share of a space (read permission)
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has sent the following space share invitation:
| space | share space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Manager |
And user " Brian " has created the following space link share:
| space | share space |
2025-01-21 11:54:57 +05:45
| permissionsRole | View |
2024-05-10 15:13:57 +05:45
| password | %public% |
2023-12-02 08:24:56 +05:45
When user " Brian " updates the last public link share using the sharing API with
| permissions | 1 |
| password | |
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
2023-12-02 08:24:56 +05:45
And the OCS status code should be " 104 "
And the OCS status message should be " user is not allowed to delete the password from the public link "
2023-12-07 12:11:26 +05:45
Examples:
2024-03-21 09:14:50 +05:45
| ocs-api-version | http-status-code |
2023-12-07 12:11:26 +05:45
| 1 | 200 |
| 2 | 403 |
2023-12-02 08:24:56 +05:45
Scenario Outline: space manager tries to remove password of a public link share of a space (various permission)
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has sent the following space share invitation:
| space | share space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Manager |
And user " Brian " has created the following space link share:
| space | share space |
| permissionsRole | <permissions-role> |
| password | %public% |
2023-12-02 08:24:56 +05:45
When user " Brian " updates the last public link share using the sharing API with
| permissions | <permissions> |
| password | |
2024-03-21 09:14:50 +05:45
Then the HTTP status code should be " <http-status-code> "
2023-12-02 08:24:56 +05:45
And the OCS status code should be " 400 "
And the OCS status message should be " missing required password "
Examples:
2024-05-10 15:13:57 +05:45
| ocs-api-version | permissions | http-status-code | permissions-role |
2025-01-21 11:54:57 +05:45
| 1 | 5 | 200 | Upload |
| 2 | 5 | 400 | Upload |
| 1 | 15 | 200 | Edit |
| 2 | 15 | 400 | Edit |
| 1 | 4 | 200 | File Drop |
| 2 | 4 | 400 | File Drop |
2023-12-06 17:00:47 +05:45
Scenario Outline: space manager removes password of a public link share of a space (invite permission)
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has sent the following space share invitation:
| space | share space |
| sharee | Brian |
| shareType | user |
| permissionsRole | Manager |
And user " Brian " has created the following space link share:
| space | share space |
2025-01-21 11:54:57 +05:45
| permissionsRole | View |
2024-05-10 15:13:57 +05:45
| password | %public% |
2023-12-06 17:00:47 +05:45
When user " Brian " updates the last public link share using the sharing API with
| permissions | 0 |
| password | |
Then the HTTP status code should be " 200 "
2024-03-21 09:14:50 +05:45
And the OCS status code should be " <ocs-status-code> "
2023-12-06 17:00:47 +05:45
And the OCS status message should be " OK "
Examples:
2024-03-21 09:14:50 +05:45
| ocs-api-version | ocs-status-code |
2023-12-06 17:00:47 +05:45
| 1 | 100 |
| 2 | 200 |
Scenario Outline: space member tries to remove the password of a public link share of a space
2024-03-21 09:14:50 +05:45
Given using OCS API version " <ocs-api-version> "
2024-05-10 15:13:57 +05:45
And using SharingNG
And user " Alice " has sent the following space share invitation:
| space | share space |
| sharee | Brian |
| shareType | user |
| permissionsRole | <space-role> |
And user " Alice " has created the following space link share:
| space | share space |
| permissionsRole | <permissions-role> |
| password | %public% |
2023-12-06 17:00:47 +05:45
When user " Brian " updates the last public link share using the sharing API with
| permissions | <permissions> |
2024-03-21 09:14:50 +05:45
| password | |
Then the HTTP status code should be " <http-status-code> "
2023-12-06 17:00:47 +05:45
And the OCS status code should be " 997 "
And the OCS status message should be " missing permissions to update share "
Examples:
2024-05-10 15:13:57 +05:45
| ocs-api-version | http-status-code | space-role | permissions | permissions-role |
2025-01-21 11:54:57 +05:45
| 1 | 200 | Space Viewer | 1 | View |
| 2 | 401 | Space Viewer | 1 | View |
| 1 | 200 | Space Viewer | 5 | Upload |
| 2 | 401 | Space Viewer | 5 | Upload |
| 1 | 200 | Space Viewer | 15 | Edit |
| 2 | 401 | Space Viewer | 15 | Edit |
| 1 | 200 | Space Viewer | 4 | File Drop |
| 2 | 401 | Space Viewer | 4 | File Drop |
| 1 | 200 | Space Editor | 1 | View |
| 2 | 401 | Space Editor | 1 | View |
| 1 | 200 | Space Editor | 5 | Upload |
| 2 | 401 | Space Editor | 5 | Upload |
| 1 | 200 | Space Editor | 15 | Edit |
| 2 | 401 | Space Editor | 15 | Edit |
| 1 | 200 | Space Editor | 4 | File Drop |
| 2 | 401 | Space Editor | 4 | File Drop |