-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsharing-user.feature
174 lines (164 loc) · 9.45 KB
/
sharing-user.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
Feature: Sharing user
Background:
Given user "test1" exists
Given as user "test1"
Given user "test2" exists
And using new dav path
Scenario: Creating file is blocked
Given user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileName", "operator": "is", "value": "foobar.txt"} |
And User "test1" uploads file "data/textfile.txt" to "/foobar.txt"
Then The webdav response should have a status code "403"
Scenario: Downloading file is blocked
Given User "test1" uploads file "data/textfile.txt" to "/foobar.txt"
And The webdav response should have a status code "201"
And user "test1" shares file "/foobar.txt" with user "test2"
And as user "test2"
When Downloading file "/foobar.txt"
Then The webdav response should have a status code "200"
When Downloading file "/foobar.txt" with range "1-4"
Then The webdav response should have a status code "200"
And user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileName", "operator": "is", "value": "foobar.txt"} |
And as user "test2"
When Downloading file "/foobar.txt"
Then The webdav response should have a status code "403"
When Downloading file "/foobar.txt" with range "1-4"
Then The webdav response should have a status code "403"
Scenario: Updating file is blocked
Given User "test1" uploads file "data/textfile.txt" to "/foobar.txt"
And The webdav response should have a status code "201"
And user "test1" shares file "/foobar.txt" with user "test2"
And user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileName", "operator": "is", "value": "foobar.txt"} |
And as user "test2"
When User "test2" uploads file "data/textfile-2.txt" to "/foobar.txt"
Then The webdav response should have a status code "403"
Scenario: Deleting file that is shared directly is not blocked because it unshares from self
Given User "test1" uploads file "data/textfile.txt" to "/foobar.txt"
And The webdav response should have a status code "201"
And user "test1" shares file "/foobar.txt" with user "test2"
And user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileName", "operator": "is", "value": "foobar.txt"} |
And as user "test2"
When User "test2" deletes file "/foobar.txt"
Then The webdav response should have a status code "204"
Scenario: Deleting file inside a shared folder is blocked
Given User "test1" created a folder "/subdir"
Given User "test1" uploads file "data/textfile.txt" to "/subdir/foobar.txt"
And The webdav response should have a status code "201"
And user "test1" shares file "/subdir" with user "test2"
And user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileName", "operator": "is", "value": "foobar.txt"} |
And as user "test2"
When User "test2" deletes file "/subdir/foobar.txt"
Then The webdav response should have a status code "403"
Scenario: Upload and share a file that is allowed by mimetype excludes
And user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileMimeType", "operator": "!is", "value": "httpd/directory"} |
| checks-1 | {"class":"OCA\\WorkflowEngine\\Check\\FileMimeType", "operator": "!is", "value": "application/pdf"} |
Given User "test1" uploads file "data/nextcloud.pdf" to "/nextcloud.pdf"
And The webdav response should have a status code "201"
And user "test1" shares file "/nextcloud.pdf" with user "test2"
And Downloading file "/nextcloud.pdf" as "test1"
And The webdav response should have a status code "200"
And Downloading file "/nextcloud.pdf" as "test2"
And The webdav response should have a status code "200"
Scenario: Share a file that is allowed by mimetype excludes
Given User "test1" uploads file "data/nextcloud.pdf" to "/nextcloud2.pdf"
And The webdav response should have a status code "201"
And user "test1" shares file "/nextcloud2.pdf" with user "test2"
And Downloading file "/nextcloud2.pdf" as "test1"
And The webdav response should have a status code "200"
And user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileMimeType", "operator": "!is", "value": "httpd/directory"} |
| checks-1 | {"class":"OCA\\WorkflowEngine\\Check\\FileMimeType", "operator": "!is", "value": "application/pdf"} |
And Downloading file "/nextcloud2.pdf" as "test2"
And The webdav response should have a status code "200"
Scenario: Jailed storage cache bug blocking first
Given Ensure tag exists
Given User "test1" uploads file "data/textfile.txt" to "/nextcloud2.txt"
And The webdav response should have a status code "201"
Given User "test1" uploads file "data/textfile.txt" to "/nextcloud3.txt"
And The webdav response should have a status code "201"
And user "test1" shares file "/nextcloud2.txt" with user "test2"
And Downloading file "/nextcloud2.txt" as "test2"
And The webdav response should have a status code "200"
And user "test1" shares file "/nextcloud3.txt" with user "test2"
And Downloading file "/nextcloud3.txt" as "test2"
And The webdav response should have a status code "200"
And user "test1" tags file "/nextcloud2.txt"
When user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileSystemTags", "operator": "is", "value": "{{{FILES_ACCESSCONTROL_INTEGRATIONTEST_TAGID}}}"} |
Then Downloading file "/nextcloud2.txt" as "test2"
And The webdav response should have a status code "404"
And Downloading file "/nextcloud3.txt" as "test2"
And The webdav response should have a status code "200"
And user "test2" should see following elements
| /nextcloud3.txt |
Scenario: Jailed storage cache bug blocking last
Given Ensure tag exists
Given User "test1" uploads file "data/textfile.txt" to "/nextcloud2.txt"
And The webdav response should have a status code "201"
Given User "test1" uploads file "data/textfile.txt" to "/nextcloud3.txt"
And The webdav response should have a status code "201"
And user "test1" shares file "/nextcloud2.txt" with user "test2"
And Downloading file "/nextcloud2.txt" as "test2"
And The webdav response should have a status code "200"
And user "test1" shares file "/nextcloud3.txt" with user "test2"
And Downloading file "/nextcloud3.txt" as "test2"
And The webdav response should have a status code "200"
And user "test1" tags file "/nextcloud3.txt"
When user "admin" creates global flow with 200
| name | Admin flow |
| class | OCA\FilesAccessControl\Operation |
| entity | OCA\WorkflowEngine\Entity\File |
| events | [] |
| operation | deny |
| checks-0 | {"class":"OCA\\WorkflowEngine\\Check\\FileSystemTags", "operator": "is", "value": "{{{FILES_ACCESSCONTROL_INTEGRATIONTEST_TAGID}}}"} |
Then Downloading file "/nextcloud2.txt" as "test2"
And The webdav response should have a status code "200"
And Downloading file "/nextcloud3.txt" as "test2"
And The webdav response should have a status code "404"
And user "test2" should see following elements
| /nextcloud2.txt |