-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
Copy pathcreateShareToRootFolder.feature
593 lines (548 loc) · 31.6 KB
/
createShareToRootFolder.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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
@api @files_sharing-app-required
Feature: sharing
Background:
Given user "Alice" has been created with default attributes and without skeleton files
@smokeTest @skipOnEncryptionType:user-keys @issue-32322
Scenario Outline: Creating a share of a file with a user, the default permissions are read(1)+update(2)+can-share(16)
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
When user "Alice" shares file "textfile0.txt" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| share_with_user_type | 0 |
| file_target | /textfile0.txt |
| path | /textfile0.txt |
| permissions | share,read,update |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | user |
And the content of file "/textfile0.txt" for user "Brian" should be "ownCloud test text file 0"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@smokeTest @skipOnEncryptionType:user-keys @issue-32322
Scenario Outline: Creating a share of a file containing commas in the filename, with a user, the default permissions are read(1)+update(2)+can-share(16)
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "file with comma in filename" to "/sample,1.txt"
When user "Alice" shares file "sample,1.txt" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| file_target | /sample,1.txt |
| path | /sample,1.txt |
| permissions | share,read,update |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | user |
And the content of file "/sample,1.txt" for user "Brian" should be "file with comma in filename"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: Creating a share of a file with a user and asking for various permission combinations
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
When user "Alice" shares file "textfile0.txt" with user "Brian" with permissions <requested_permissions> using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| file_target | /textfile0.txt |
| path | /textfile0.txt |
| permissions | <granted_permissions> |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | user |
Examples:
| ocs_api_version | requested_permissions | granted_permissions | ocs_status_code |
# Ask for full permissions. You get share plus read plus update. create and delete do not apply to shares of a file
| 1 | 31 | 19 | 100 |
| 2 | 31 | 19 | 200 |
# Ask for read, share (17), create and delete. You get share plus read
| 1 | 29 | 17 | 100 |
| 2 | 29 | 17 | 200 |
# Ask for read, update, create, delete. You get read plus update.
| 1 | 15 | 3 | 100 |
| 2 | 15 | 3 | 200 |
# Ask for just update. You get exactly update (you do not get read or anything else)
| 1 | 2 | 2 | 100 |
| 2 | 2 | 2 | 200 |
Scenario Outline: Creating a share of a file with no permissions should fail
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "Random data" to "randomfile.txt"
When user "Alice" shares file "randomfile.txt" with user "Brian" with permissions "0" using the sharing API
Then the OCS status code should be "400"
And the HTTP status code should be "<http_status_code>"
And as "Brian" file "randomfile.txt" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 400 |
Scenario Outline: Creating a share of a folder with no permissions should fail
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/afolder"
When user "Alice" shares folder "afolder" with user "Brian" with permissions "0" using the sharing API
Then the OCS status code should be "400"
And the HTTP status code should be "<http_status_code>"
And as "Brian" folder "afolder" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 400 |
Scenario Outline: Creating a share of a folder with a user, the default permissions are all permissions(31)
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/FOLDER"
When user "Alice" shares folder "/FOLDER" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| file_target | /FOLDER |
| path | /FOLDER |
| permissions | all |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | folder |
| mimetype | httpd/unix-directory |
| storage_id | ANY_VALUE |
| share_type | user |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: Creating a share of a file with a group, the default permissions are read(1)+update(2)+can-share(16)
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
When user "Alice" shares file "/textfile0.txt" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with group "grp1" should include
| share_with | grp1 |
| share_with_displayname | grp1 |
| file_target | /textfile0.txt |
| path | /textfile0.txt |
| permissions | share,read,update |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | file |
| mimetype | text/plain |
| storage_id | ANY_VALUE |
| share_type | group |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: Creating a share of a folder with a group, the default permissions are all permissions(31)
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Alice" has created folder "/FOLDER"
When user "Alice" shares folder "/FOLDER" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with group "grp1" should include
| share_with | grp1 |
| share_with_displayname | grp1 |
| file_target | /FOLDER |
| path | /FOLDER |
| permissions | all |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | folder |
| mimetype | httpd/unix-directory |
| storage_id | ANY_VALUE |
| share_type | group |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@smokeTest
Scenario Outline: Share of folder to a group
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Carol" has been added to group "grp1"
And user "Alice" has created folder "/PARENT"
And user "Alice" has uploaded file with content "file in parent folder" to "/PARENT/parent.txt"
When user "Alice" shares folder "/PARENT" with group "grp1" using the sharing API
Then user "Brian" should see the following elements
| /PARENT/ |
| /PARENT/parent.txt |
And the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should see the following elements
| /PARENT/ |
| /PARENT/parent.txt |
And the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: sharing again an own file while belonging to a group
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Brian" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Brian" has shared file "textfile0.txt" with group "grp1"
And user "Brian" has deleted the last share
When user "Brian" shares file "/textfile0.txt" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: sharing subfolder of already shared folder, GET result is correct
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
| David |
| Emily |
And user "Alice" has created folder "/folder1"
And user "Alice" has shared folder "/folder1" with user "Brian"
And user "Alice" has shared folder "/folder1" with user "Carol"
And user "Alice" has created folder "/folder1/folder2"
And user "Alice" has shared folder "/folder1/folder2" with user "David"
And user "Alice" has shared folder "/folder1/folder2" with user "Emily"
When user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares"
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the response should contain 4 entries
And folder "/folder1" should be included as path in the response
And folder "/folder1/folder2" should be included as path in the response
When user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares?path=/folder1/folder2"
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the response should contain 2 entries
And folder "/folder1" should not be included as path in the response
And folder "/folder1/folder2" should be included as path in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: user shares a file with file name longer than 64 chars to another user
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has moved file "textfile0.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "Alice" shares file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "Brian" file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: user shares a file with file name longer than 64 chars to a group
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Brian" has been created with default attributes and without skeleton files
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has moved file "textfile0.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt"
When user "Alice" shares file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And as "Brian" file "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog.txt" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: user shares a folder with folder name longer than 64 chars to another user
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has uploaded file with content "ownCloud test" to "/textfile0.txt"
And user "Alice" has created folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
And user "Alice" has moved file "textfile0.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/textfile0.txt"
When user "Alice" shares folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the content of file "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/textfile0.txt" for user "Brian" should be "ownCloud test"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: user shares a folder with folder name longer than 64 chars to a group
Given using OCS API version "<ocs_api_version>"
And group "grp1" has been created
And user "Brian" has been created with default attributes and without skeleton files
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "ownCloud test" to "/textfile0.txt"
And user "Alice" has created folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog"
And user "Alice" has moved file "textfile0.txt" to "aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/textfile0.txt"
When user "Alice" shares folder "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog" with group "grp1" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the content of file "/aquickbrownfoxjumpsoveraverylazydogaquickbrownfoxjumpsoveralazydog/textfile0.txt" for user "Brian" should be "ownCloud test"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario: share with user when username contains capital letters
Given these users have been created without skeleton files:
| username |
| brian |
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
When user "Alice" shares file "/randomfile.txt" with user "BRIAN" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "BRIAN" should include
| share_with | brian |
| file_target | /randomfile.txt |
| path | /randomfile.txt |
| permissions | share,read,update |
| uid_owner | %username% |
And user "brian" should see the following elements
| /randomfile.txt |
And the content of file "randomfile.txt" for user "brian" should be "Random data"
@skipOnLDAP
Scenario: creating a new share with user of a group when username contains capital letters
Given these users have been created without skeleton files:
| username |
| Brian |
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "Random data" to "/randomfile.txt"
When user "Alice" shares file "randomfile.txt" with group "grp1" using the sharing API
Then the OCS status code should be "100"
And the HTTP status code should be "200"
And user "Brian" should see the following elements
| /randomfile.txt |
And the content of file "randomfile.txt" for user "Brian" should be "Random data"
Scenario Outline: Share of folder to a group with emoji in the name
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And group "😀 😁" has been created
And user "Brian" has been added to group "😀 😁"
And user "Carol" has been added to group "😀 😁"
And user "Alice" has created folder "/PARENT"
And user "Alice" has uploaded file with content "file in parent folder" to "/PARENT/parent.txt"
When user "Alice" shares folder "/PARENT" with group "😀 😁" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Brian" should see the following elements
| /PARENT/ |
| /PARENT/parent.txt |
And user "Carol" should see the following elements
| /PARENT/ |
| /PARENT/parent.txt |
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnEncryptionType:user-keys @encryption-issue-132 @skipOnLDAP
Scenario Outline: share with a group and then add a user to that group
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And these groups have been created:
| groupname |
| grp1 |
And user "Brian" has been added to group "grp1"
And user "Alice" has uploaded file with content "some content" to "lorem.txt"
And user "Alice" has shared file "lorem.txt" with group "grp1"
When the administrator adds user "Carol" to group "grp1" using the provisioning API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the content of file "lorem.txt" for user "Brian" should be "some content"
And the content of file "lorem.txt" for user "Carol" should be "some content"
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnLDAP
# deleting an LDAP group is not relevant or possible using the provisioning API
Scenario Outline: shares shared to deleted group should not be available
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Carol" has been added to group "grp1"
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has shared file "/textfile0.txt" with group "grp1"
When user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares"
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with group "grp1" should include
| share_with | grp1 |
| file_target | /textfile0.txt |
| path | /textfile0.txt |
| uid_owner | %username% |
And as "Brian" file "/textfile0.txt" should exist
And as "Carol" file "/textfile0.txt" should exist
When the administrator deletes group "grp1" using the provisioning API
And user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares"
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And file "/textfile0.txt" should not be included as path in the response
And as "Brian" file "/textfile0.txt" should not exist
And as "Carol" file "/textfile0.txt" should not exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
@skipOnFilesClassifier @issue-files-classifier-291
Scenario: Share a file by multiple channels and download from sub-folder and direct file share
Given these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And group "grp1" has been created
And user "Brian" has been added to group "grp1"
And user "Carol" has been added to group "grp1"
And user "Alice" has created folder "/common"
And user "Alice" has created folder "/common/sub"
And user "Alice" has shared folder "common" with group "grp1"
And user "Brian" has uploaded file with content "ownCloud" to "/textfile0.txt"
And user "Brian" has shared file "textfile0.txt" with user "Carol"
And user "Brian" has moved file "/textfile0.txt" to "/common/textfile0.txt"
And user "Brian" has moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
When user "Carol" uploads file "filesForUpload/file_to_overwrite.txt" to "/textfile0.txt" using the WebDAV API
Then the HTTP status code should be "204"
And the content of file "/common/sub/textfile0.txt" for user "Carol" should be "BLABLABLA" plus end-of-line
And the content of file "/textfile0.txt" for user "Carol" should be "BLABLABLA" plus end-of-line
And user "Carol" should see the following elements
| /common/sub/textfile0.txt |
| /textfile0.txt |
Scenario Outline: sharing back to resharer is not allowed
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And user "Alice" has created folder "userZeroFolder"
And user "Alice" has shared folder "userZeroFolder" with user "Brian"
And user "Brian" has created folder "userZeroFolder/userOneFolder"
And user "Brian" has shared folder "userZeroFolder/userOneFolder" with user "Carol" with permissions "read, share"
When user "Carol" shares folder "userOneFolder" with user "Brian" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Brian" folder "userOneFolder" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: sharing back to original sharer is not allowed
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And user "Alice" has created folder "userZeroFolder"
And user "Alice" has shared folder "userZeroFolder" with user "Brian"
And user "Brian" has created folder "userZeroFolder/userOneFolder"
And user "Brian" has shared folder "userZeroFolder/userOneFolder" with user "Carol" with permissions "read, share"
When user "Carol" shares folder "userOneFolder" with user "Alice" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Alice" folder "userOneFolder" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
@issue-enterprise-3896
Scenario Outline: sharing a subfolder to a user that already received parent folder share is not allowed
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
| David |
And user "Alice" has created folder "userZeroFolder"
And user "Alice" has shared folder "userZeroFolder" with user "Brian"
And user "Alice" has shared folder "userZeroFolder" with user "Carol"
And user "Brian" has created folder "userZeroFolder/userOneFolder"
And user "Brian" has shared folder "userZeroFolder/userOneFolder" with user "David" with permissions "read, share"
When user "David" shares folder "userOneFolder" with user "Carol" using the sharing API
Then the OCS status code should be "404"
And the HTTP status code should be "<http_status_code>"
And as "Carol" folder "userOneFolder" should not exist
Examples:
| ocs_api_version | http_status_code |
| 1 | 200 |
| 2 | 404 |
Scenario Outline: shares to a deleted user should not be listed as shares for the sharer
Given using OCS API version "<ocs_api_version>"
And these users have been created with default attributes and without skeleton files:
| username |
| Brian |
| Carol |
And user "Alice" has uploaded file with content "ownCloud test text file 0" to "/textfile0.txt"
And user "Alice" has shared file "textfile0.txt" with user "Brian"
And user "Alice" has shared file "textfile0.txt" with user "Carol"
And the administrator has deleted user "Brian" using the provisioning API
When user "Alice" gets all the shares from the file "textfile0.txt" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And user "Carol" should be included in the response
But user "Brian" should not be included in the response
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |
Scenario Outline: Creating a share of a renamed file when another share exists
Given using OCS API version "<ocs_api_version>"
And user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "/Folder1"
And user "Alice" has created folder "/Folder2"
And user "Alice" has shared folder "/Folder1" with user "Brian"
And user "Alice" has moved folder "/Folder2" to "/renamedFolder2"
When user "Alice" shares folder "/renamedFolder2" with user "Brian" using the sharing API
Then the OCS status code should be "<ocs_status_code>"
And the HTTP status code should be "200"
And the fields of the last response to user "Alice" sharing with user "Brian" should include
| share_with | %username% |
| share_with_displayname | %displayname% |
| file_target | /renamedFolder2 |
| path | /renamedFolder2 |
| permissions | all |
| uid_owner | %username% |
| displayname_owner | %displayname% |
| item_type | folder |
| mimetype | httpd/unix-directory |
| storage_id | ANY_VALUE |
| share_type | user |
And as "Brian" folder "/renamedFolder2" should exist
Examples:
| ocs_api_version | ocs_status_code |
| 1 | 100 |
| 2 | 200 |