-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
reShareAsPublicLinkToSharesOldDav.feature
117 lines (106 loc) · 6.13 KB
/
reShareAsPublicLinkToSharesOldDav.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
@api @files_sharing-app-required @public_link_share-feature-required
Feature: reshare as public link
As a user
I want to create public link shares from files/folders shared with me
So that I can give controlled access to others
Background:
Given these users have been created with default attributes and without skeleton files:
| username |
| Alice |
| Brian |
And the administrator has set the default folder for received shares to "Shares"
And auto-accept shares has been disabled
Scenario Outline: creating a public link from a share with share+read only permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has uploaded file with content "some content" to "/test/file.txt"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/test" offered by user "Alice"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| publicUpload | false |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public link shared folder using the old public WebDAV API
And the downloaded content should be "some content"
But uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating a public link from a share with share+read+write permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has uploaded file with content "some content" to "/test/file.txt"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
And user "Brian" has accepted share "/test" offered by user "Alice"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| publicUpload | false |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public link shared folder using the old public WebDAV API
And the downloaded content should be "some content"
But uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: creating an upload public link from a share with share+read+write permissions is allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has uploaded file with content "some content" to "/test/file.txt"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "all"
And user "Brian" has accepted share "/test" offered by user "Alice"
When user "Brian" creates a public link share using the sharing API with settings
| path | /Shares/test |
| permissions | read,update,create,delete |
| publicUpload | true |
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the public should be able to download file "file.txt" from inside the last public link shared folder using the old public WebDAV API
And the downloaded content should be "some content"
And uploading a file should work using the old public WebDAV API
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: increasing permissions of a public link of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has created folder "/test/sub"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/test" offered by user "Alice"
And user "Brian" has created a public link share with settings
| path | /Shares/test |
| permissions | read |
| publicUpload | false |
When user "Brian" updates the last public link share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: increasing permissions of a public link from a sub-folder of a share with share+read only permissions is not allowed
Given using OCS API version "<ocs_api_version>"
And user "Alice" has created folder "/test"
And user "Alice" has created folder "/test/sub"
And user "Alice" has shared folder "/test" with user "Brian" with permissions "share,read"
And user "Brian" has accepted share "/test" offered by user "Alice"
And user "Brian" has created a public link share with settings
| path | /Shares/test/sub |
| permissions | read |
| publicUpload | false |
And uploading a file should not work using the old public WebDAV API
When user "Brian" updates the last public link share using the sharing API with
| permissions | read,update,create,delete |
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And uploading a file should not work using the old public WebDAV API
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |