sharing-v1-part2.feature 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. Feature: sharing
  2. Background:
  3. Given using api version "1"
  4. Given using old dav path
  5. # See sharing-v1.feature
  6. Scenario: getting all shares of a file with reshares
  7. Given user "user0" exists
  8. And user "user1" exists
  9. And user "user2" exists
  10. And user "user3" exists
  11. And file "textfile0.txt" of user "user0" is shared with user "user1"
  12. And user "user1" accepts last share
  13. And file "textfile0 (2).txt" of user "user1" is shared with user "user2"
  14. And As an "user0"
  15. When sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=textfile0.txt"
  16. Then the OCS status code should be "100"
  17. And the HTTP status code should be "200"
  18. And User "user1" should be included in the response
  19. And User "user2" should be included in the response
  20. And User "user3" should not be included in the response
  21. Scenario: getting all shares of a file with a received share after revoking the resharing rights
  22. Given user "user0" exists
  23. And user "user1" exists
  24. And user "user2" exists
  25. And file "textfile0.txt" of user "user1" is shared with user "user0"
  26. And user "user0" accepts last share
  27. And Updating last share with
  28. | permissions | 1 |
  29. And file "textfile0.txt" of user "user1" is shared with user "user2"
  30. When As an "user0"
  31. And sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=/textfile0 (2).txt"
  32. Then the list of returned shares has 1 shares
  33. And share 0 is returned with
  34. | share_type | 0 |
  35. | uid_owner | user1 |
  36. | displayname_owner | user1 |
  37. | path | /textfile0 (2).txt |
  38. | item_type | file |
  39. | mimetype | text/plain |
  40. | storage_id | shared::/textfile0 (2).txt |
  41. | file_target | /textfile0.txt |
  42. | share_with | user2 |
  43. | share_with_displayname | user2 |
  44. Scenario: getting all shares of a file with a received share also reshared after revoking the resharing rights
  45. Given user "user0" exists
  46. And user "user1" exists
  47. And user "user2" exists
  48. And user "user3" exists
  49. And file "textfile0.txt" of user "user1" is shared with user "user0"
  50. And user "user0" accepts last share
  51. And save the last share data as "textfile0.txt from user1"
  52. And file "textfile0 (2).txt" of user "user0" is shared with user "user3"
  53. And restore the last share data from "textfile0.txt from user1"
  54. And Updating last share with
  55. | permissions | 1 |
  56. And file "textfile0.txt" of user "user1" is shared with user "user2"
  57. When As an "user0"
  58. And sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=/textfile0 (2).txt"
  59. Then the list of returned shares has 2 shares
  60. And share 0 is returned with
  61. | share_type | 0 |
  62. | uid_owner | user0 |
  63. | displayname_owner | user0 |
  64. | uid_file_owner | user1 |
  65. | displayname_file_owner | user1 |
  66. | path | /textfile0 (2).txt |
  67. | item_type | file |
  68. | mimetype | text/plain |
  69. | storage_id | shared::/textfile0 (2).txt |
  70. | file_target | /textfile0 (2).txt |
  71. | share_with | user3 |
  72. | share_with_displayname | user3 |
  73. And share 1 is returned with
  74. | share_type | 0 |
  75. | uid_owner | user1 |
  76. | displayname_owner | user1 |
  77. | path | /textfile0 (2).txt |
  78. | item_type | file |
  79. | mimetype | text/plain |
  80. | storage_id | shared::/textfile0 (2).txt |
  81. | file_target | /textfile0.txt |
  82. | share_with | user2 |
  83. | share_with_displayname | user2 |
  84. Scenario: Reshared files can be still accessed if a user in the middle removes it.
  85. Given user "user0" exists
  86. And user "user1" exists
  87. And user "user2" exists
  88. And user "user3" exists
  89. And file "textfile0.txt" of user "user0" is shared with user "user1"
  90. And user "user1" accepts last share
  91. And file "textfile0 (2).txt" of user "user1" is shared with user "user2"
  92. And user "user2" accepts last share
  93. And file "textfile0 (2).txt" of user "user2" is shared with user "user3"
  94. And user "user3" accepts last share
  95. And As an "user1"
  96. When User "user1" deletes file "/textfile0 (2).txt"
  97. And As an "user3"
  98. And Downloading file "/textfile0 (2).txt" with range "bytes=1-8"
  99. Then Downloaded content should be "extcloud"
  100. Scenario: getting share info of a share
  101. Given user "user0" exists
  102. And user "user1" exists
  103. And file "textfile0.txt" of user "user0" is shared with user "user1"
  104. And As an "user0"
  105. When Getting info of last share
  106. Then the OCS status code should be "100"
  107. And the HTTP status code should be "200"
  108. And Share fields of last share match with
  109. | id | A_NUMBER |
  110. | item_type | file |
  111. | item_source | A_NUMBER |
  112. | share_type | 0 |
  113. | share_with | user1 |
  114. | file_source | A_NUMBER |
  115. | file_target | /textfile0.txt |
  116. | path | /textfile0.txt |
  117. | permissions | 19 |
  118. | stime | A_NUMBER |
  119. | storage | A_NUMBER |
  120. | mail_send | 0 |
  121. | uid_owner | user0 |
  122. | storage_id | home::user0 |
  123. | file_parent | A_NUMBER |
  124. | share_with_displayname | user1 |
  125. | displayname_owner | user0 |
  126. | mimetype | text/plain |
  127. Scenario: getting share info of a group share
  128. Given user "user0" exists
  129. And user "user1" exists
  130. And group "group1" exists
  131. And user "user1" belongs to group "group1"
  132. And file "textfile0.txt" of user "user0" is shared with group "group1"
  133. And As an "user0"
  134. When Getting info of last share
  135. Then the OCS status code should be "100"
  136. And the HTTP status code should be "200"
  137. And Share fields of last share match with
  138. | id | A_NUMBER |
  139. | item_type | file |
  140. | item_source | A_NUMBER |
  141. | share_type | 1 |
  142. | share_with | group1 |
  143. | file_source | A_NUMBER |
  144. | file_target | /textfile0.txt |
  145. | path | /textfile0.txt |
  146. | permissions | 19 |
  147. | stime | A_NUMBER |
  148. | storage | A_NUMBER |
  149. | mail_send | 0 |
  150. | uid_owner | user0 |
  151. | storage_id | home::user0 |
  152. | file_parent | A_NUMBER |
  153. | share_with_displayname | group1 |
  154. | displayname_owner | user0 |
  155. | mimetype | text/plain |
  156. And As an "user1"
  157. And accepting last share
  158. And Getting info of last share
  159. And the OCS status code should be "100"
  160. And the HTTP status code should be "200"
  161. And Share fields of last share match with
  162. | id | A_NUMBER |
  163. | item_type | file |
  164. | item_source | A_NUMBER |
  165. | share_type | 1 |
  166. | share_with | group1 |
  167. | file_source | A_NUMBER |
  168. | file_target | /textfile0 (2).txt |
  169. | path | /textfile0 (2).txt |
  170. | permissions | 19 |
  171. | stime | A_NUMBER |
  172. | storage | A_NUMBER |
  173. | mail_send | 0 |
  174. | uid_owner | user0 |
  175. | storage_id | shared::/textfile0 (2).txt |
  176. | file_parent | A_NUMBER |
  177. | share_with_displayname | group1 |
  178. | displayname_owner | user0 |
  179. | mimetype | text/plain |
  180. Scenario: getting all shares including subfiles in a directory
  181. Given user "user0" exists
  182. And user "user1" exists
  183. And user "user2" exists
  184. And file "PARENT/CHILD" of user "user0" is shared with user "user1"
  185. And file "PARENT/parent.txt" of user "user0" is shared with user "user2"
  186. When As an "user0"
  187. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=PARENT"
  188. Then the list of returned shares has 2 shares
  189. And share 0 is returned with
  190. | share_type | 0 |
  191. | uid_owner | user0 |
  192. | displayname_owner | user0 |
  193. | path | /PARENT/CHILD |
  194. | item_type | folder |
  195. | mimetype | httpd/unix-directory |
  196. | storage_id | home::user0 |
  197. | file_target | /CHILD |
  198. | share_with | user1 |
  199. | share_with_displayname | user1 |
  200. | permissions | 31 |
  201. And share 1 is returned with
  202. | share_type | 0 |
  203. | uid_owner | user0 |
  204. | displayname_owner | user0 |
  205. | path | /PARENT/parent.txt |
  206. | item_type | file |
  207. | mimetype | text/plain |
  208. | storage_id | home::user0 |
  209. | file_target | /parent.txt |
  210. | share_with | user2 |
  211. | share_with_displayname | user2 |
  212. Scenario: getting all shares including subfiles in a directory with received shares
  213. Given user "user0" exists
  214. And user "user1" exists
  215. And file "textfile0.txt" of user "user0" is shared with user "user1"
  216. And user "user1" accepts last share
  217. And file "textfile0.txt" of user "user1" is shared with user "user0"
  218. When As an "user0"
  219. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=/"
  220. Then the list of returned shares has 1 shares
  221. And share 0 is returned with
  222. | share_type | 0 |
  223. | uid_owner | user0 |
  224. | displayname_owner | user0 |
  225. | path | /textfile0.txt |
  226. | item_type | file |
  227. | mimetype | text/plain |
  228. | storage_id | home::user0 |
  229. | file_target | /textfile0 (2).txt |
  230. | share_with | user1 |
  231. | share_with_displayname | user1 |
  232. Scenario: getting all shares including subfiles in a directory with shares in subdirectories
  233. Given user "user0" exists
  234. And user "user1" exists
  235. And user "user2" exists
  236. And file "PARENT/CHILD" of user "user0" is shared with user "user1"
  237. And file "PARENT/CHILD/child.txt" of user "user0" is shared with user "user2"
  238. When As an "user0"
  239. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=PARENT"
  240. Then the list of returned shares has 1 shares
  241. And share 0 is returned with
  242. | share_type | 0 |
  243. | uid_owner | user0 |
  244. | displayname_owner | user0 |
  245. | path | /PARENT/CHILD |
  246. | item_type | folder |
  247. | mimetype | httpd/unix-directory |
  248. | storage_id | home::user0 |
  249. | file_target | /CHILD |
  250. | share_with | user1 |
  251. | share_with_displayname | user1 |
  252. | permissions | 31 |
  253. Scenario: getting all shares including subfiles in a shared directory with reshares
  254. Given user "user0" exists
  255. And user "user1" exists
  256. And user "user2" exists
  257. And user "user3" exists
  258. And file "PARENT" of user "user0" is shared with user "user1"
  259. And user "user1" accepts last share
  260. And file "PARENT (2)/CHILD" of user "user1" is shared with user "user2"
  261. And user "user2" accepts last share
  262. And file "CHILD" of user "user2" is shared with user "user3"
  263. When As an "user0"
  264. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=PARENT"
  265. Then the list of returned shares has 2 shares
  266. And share 0 is returned with
  267. | share_type | 0 |
  268. | uid_owner | user1 |
  269. | displayname_owner | user1 |
  270. | uid_file_owner | user0 |
  271. | displayname_file_owner | user0 |
  272. | path | /PARENT/CHILD |
  273. | item_type | folder |
  274. | mimetype | httpd/unix-directory |
  275. | storage_id | home::user0 |
  276. | file_target | /CHILD |
  277. | share_with | user2 |
  278. | share_with_displayname | user2 |
  279. | permissions | 31 |
  280. And share 1 is returned with
  281. | share_type | 0 |
  282. | uid_owner | user2 |
  283. | displayname_owner | user2 |
  284. | uid_file_owner | user0 |
  285. | displayname_file_owner | user0 |
  286. | path | /PARENT/CHILD |
  287. | item_type | folder |
  288. | mimetype | httpd/unix-directory |
  289. | storage_id | home::user0 |
  290. | file_target | /CHILD |
  291. | share_with | user3 |
  292. | share_with_displayname | user3 |
  293. | permissions | 31 |
  294. Scenario: getting all shares including subfiles in a directory by a resharer
  295. Given user "user0" exists
  296. And user "user1" exists
  297. And user "user2" exists
  298. And user "user3" exists
  299. And file "PARENT" of user "user0" is shared with user "user1"
  300. And user "user1" accepts last share
  301. And file "PARENT (2)/CHILD" of user "user1" is shared with user "user2"
  302. And user "user2" accepts last share
  303. And file "CHILD" of user "user2" is shared with user "user3"
  304. When As an "user1"
  305. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=PARENT (2)"
  306. Then the list of returned shares has 2 shares
  307. And share 0 is returned with
  308. | share_type | 0 |
  309. | uid_owner | user1 |
  310. | displayname_owner | user1 |
  311. | uid_file_owner | user0 |
  312. | displayname_file_owner | user0 |
  313. | path | /PARENT (2)/CHILD |
  314. | item_type | folder |
  315. | mimetype | httpd/unix-directory |
  316. | storage_id | shared::/PARENT (2) |
  317. | file_target | /CHILD |
  318. | share_with | user2 |
  319. | share_with_displayname | user2 |
  320. | permissions | 31 |
  321. And share 1 is returned with
  322. | share_type | 0 |
  323. | uid_owner | user2 |
  324. | displayname_owner | user2 |
  325. | uid_file_owner | user0 |
  326. | displayname_file_owner | user0 |
  327. | path | /PARENT (2)/CHILD |
  328. | item_type | folder |
  329. | mimetype | httpd/unix-directory |
  330. | storage_id | shared::/PARENT (2) |
  331. | file_target | /CHILD |
  332. | share_with | user3 |
  333. | share_with_displayname | user3 |
  334. | permissions | 31 |
  335. Scenario: getting all shares including subfiles in a directory by a resharer after revoking the resharing rights
  336. Given user "user0" exists
  337. And user "user1" exists
  338. And user "user2" exists
  339. And user "user3" exists
  340. And file "PARENT" of user "user0" is shared with user "user1"
  341. And save the last share data as "parent folder"
  342. And user "user1" accepts last share
  343. And file "PARENT (2)/CHILD" of user "user1" is shared with user "user2"
  344. And user "user2" accepts last share
  345. And file "CHILD" of user "user2" is shared with user "user3"
  346. And As an "user0"
  347. And restore the last share data from "parent folder"
  348. And Updating last share with
  349. | permissions | 1 |
  350. When As an "user1"
  351. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=PARENT (2)"
  352. Then the list of returned shares has 1 shares
  353. And share 0 is returned with
  354. | share_type | 0 |
  355. | uid_owner | user1 |
  356. | displayname_owner | user1 |
  357. | uid_file_owner | user0 |
  358. | displayname_file_owner | user0 |
  359. | path | /PARENT (2)/CHILD |
  360. | item_type | folder |
  361. | mimetype | httpd/unix-directory |
  362. | storage_id | shared::/PARENT (2) |
  363. | file_target | /CHILD |
  364. | share_with | user2 |
  365. | share_with_displayname | user2 |
  366. | permissions | 31 |
  367. Scenario: getting all shares including subfiles in a directory after moving a received share not reshareable also shared with another user
  368. Given user "user0" exists
  369. And user "user1" exists
  370. And user "user2" exists
  371. And file "textfile0.txt" of user "user1" is shared with user "user0"
  372. And user "user0" accepts last share
  373. And Updating last share with
  374. | permissions | 1 |
  375. And file "textfile0.txt" of user "user1" is shared with user "user2"
  376. And User "user0" moved file "/textfile0 (2).txt" to "/FOLDER/textfile0.txt"
  377. When As an "user0"
  378. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=/FOLDER"
  379. Then the list of returned shares has 1 shares
  380. And share 0 is returned with
  381. | share_type | 0 |
  382. | uid_owner | user1 |
  383. | displayname_owner | user1 |
  384. | path | /FOLDER/textfile0.txt |
  385. | item_type | file |
  386. | mimetype | text/plain |
  387. | storage_id | shared::/FOLDER/textfile0.txt |
  388. | file_target | /textfile0.txt |
  389. | share_with | user2 |
  390. | share_with_displayname | user2 |
  391. Scenario: getting all shares including subfiles in a directory after moving a share and a received share not reshareable also shared with another user
  392. Given user "user0" exists
  393. And user "user1" exists
  394. And user "user2" exists
  395. And file "textfile0.txt" of user "user0" is shared with user "user1"
  396. And user "user1" accepts last share
  397. And file "textfile0.txt" of user "user1" is shared with user "user0"
  398. And user "user0" accepts last share
  399. And Updating last share with
  400. | permissions | 1 |
  401. And file "textfile0.txt" of user "user1" is shared with user "user2"
  402. And User "user0" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  403. And User "user0" moved file "/textfile0 (2).txt" to "/FOLDER/textfile0 (2).txt"
  404. When As an "user0"
  405. And sending "GET" to "/apps/files_sharing/api/v1/shares?subfiles=true&path=/FOLDER"
  406. Then the list of returned shares has 2 shares
  407. And share 0 is returned with
  408. | share_type | 0 |
  409. | uid_owner | user0 |
  410. | displayname_owner | user0 |
  411. | path | /FOLDER/textfile0.txt |
  412. | item_type | file |
  413. | mimetype | text/plain |
  414. | storage_id | home::user0 |
  415. | file_target | /textfile0 (2).txt |
  416. | share_with | user1 |
  417. | share_with_displayname | user1 |
  418. And share 1 is returned with
  419. | share_type | 0 |
  420. | uid_owner | user1 |
  421. | displayname_owner | user1 |
  422. | path | /FOLDER/textfile0 (2).txt |
  423. | item_type | file |
  424. | mimetype | text/plain |
  425. | storage_id | shared::/FOLDER/textfile0 (2).txt |
  426. | file_target | /textfile0.txt |
  427. | share_with | user2 |
  428. | share_with_displayname | user2 |
  429. Scenario: keep group permissions in sync
  430. Given As an "admin"
  431. Given user "user0" exists
  432. And user "user1" exists
  433. And group "group1" exists
  434. And user "user1" belongs to group "group1"
  435. And file "textfile0.txt" of user "user0" is shared with group "group1"
  436. And user "user1" accepts last share
  437. And User "user1" moved file "/textfile0 (2).txt" to "/FOLDER/textfile0.txt"
  438. And As an "user0"
  439. When Updating last share with
  440. | permissions | 1 |
  441. And Getting info of last share
  442. Then the OCS status code should be "100"
  443. And the HTTP status code should be "200"
  444. And Share fields of last share match with
  445. | id | A_NUMBER |
  446. | item_type | file |
  447. | item_source | A_NUMBER |
  448. | share_type | 1 |
  449. | file_source | A_NUMBER |
  450. | file_target | /textfile0.txt |
  451. | permissions | 1 |
  452. | stime | A_NUMBER |
  453. | storage | A_NUMBER |
  454. | mail_send | 0 |
  455. | uid_owner | user0 |
  456. | storage_id | home::user0 |
  457. | file_parent | A_NUMBER |
  458. | displayname_owner | user0 |
  459. | mimetype | text/plain |
  460. And As an "user1"
  461. And Getting info of last share
  462. And the OCS status code should be "100"
  463. And the HTTP status code should be "200"
  464. And Share fields of last share match with
  465. | id | A_NUMBER |
  466. | item_type | file |
  467. | item_source | A_NUMBER |
  468. | share_type | 1 |
  469. | file_source | A_NUMBER |
  470. | file_target | /FOLDER/textfile0.txt |
  471. | permissions | 1 |
  472. | stime | A_NUMBER |
  473. | storage | A_NUMBER |
  474. | mail_send | 0 |
  475. | uid_owner | user0 |
  476. | storage_id | shared::/FOLDER/textfile0.txt |
  477. | file_parent | A_NUMBER |
  478. | displayname_owner | user0 |
  479. | mimetype | text/plain |
  480. Scenario: Sharee can see the share
  481. Given user "user0" exists
  482. And user "user1" exists
  483. And file "textfile0.txt" of user "user0" is shared with user "user1"
  484. And As an "user1"
  485. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  486. Then the OCS status code should be "100"
  487. And the HTTP status code should be "200"
  488. And last share_id is included in the answer
  489. Scenario: Sharee can see the filtered share
  490. Given user "user0" exists
  491. And user "user1" exists
  492. And file "textfile0.txt" of user "user0" is shared with user "user1"
  493. And file "textfile1.txt" of user "user0" is shared with user "user1"
  494. And user "user1" accepts last share
  495. And As an "user1"
  496. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true&path=textfile1 (2).txt"
  497. Then the OCS status code should be "100"
  498. And the HTTP status code should be "200"
  499. And last share_id is included in the answer
  500. Scenario: Sharee can't see the share that is filtered out
  501. Given user "user0" exists
  502. And user "user1" exists
  503. And file "textfile0.txt" of user "user0" is shared with user "user1"
  504. And user "user1" accepts last share
  505. And file "textfile1.txt" of user "user0" is shared with user "user1"
  506. And As an "user1"
  507. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true&path=textfile0 (2).txt"
  508. Then the OCS status code should be "100"
  509. And the HTTP status code should be "200"
  510. And last share_id is not included in the answer
  511. Scenario: Sharee can see the group share
  512. Given As an "admin"
  513. And user "user0" exists
  514. And user "user1" exists
  515. And group "group0" exists
  516. And user "user1" belongs to group "group0"
  517. And file "textfile0.txt" of user "user0" is shared with group "group0"
  518. And As an "user1"
  519. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  520. Then the OCS status code should be "100"
  521. And the HTTP status code should be "200"
  522. And last share_id is included in the answer
  523. Scenario: User is not allowed to reshare file
  524. As an "admin"
  525. Given user "user0" exists
  526. And user "user1" exists
  527. And user "user2" exists
  528. And As an "user0"
  529. And creating a share with
  530. | path | /textfile0.txt |
  531. | shareType | 0 |
  532. | shareWith | user1 |
  533. | permissions | 8 |
  534. And As an "user1"
  535. And accepting last share
  536. When creating a share with
  537. | path | /textfile0 (2).txt |
  538. | shareType | 0 |
  539. | shareWith | user2 |
  540. | permissions | 31 |
  541. Then the OCS status code should be "404"
  542. And the HTTP status code should be "200"
  543. Scenario: User is allowed to reshare file with more permissions if shares of same file to same user have them
  544. Given user "user0" exists
  545. And user "user1" exists
  546. And user "user2" exists
  547. And group "group1" exists
  548. And user "user1" belongs to group "group1"
  549. And As an "user0"
  550. And creating a share with
  551. | path | /textfile0.txt |
  552. | shareType | 1 |
  553. | shareWith | group1 |
  554. | permissions | 15 |
  555. And As an "user1"
  556. And accepting last share
  557. And As an "user0"
  558. And creating a share with
  559. | path | /textfile0.txt |
  560. | shareType | 0 |
  561. | shareWith | user1 |
  562. | permissions | 17 |
  563. And As an "user1"
  564. And accepting last share
  565. When creating a share with
  566. | path | /textfile0 (2).txt |
  567. | shareType | 0 |
  568. | shareWith | user2 |
  569. | permissions | 19 |
  570. Then the OCS status code should be "100"
  571. And the HTTP status code should be "200"
  572. Scenario: User is not allowed to reshare file with more permissions
  573. As an "admin"
  574. Given user "user0" exists
  575. And user "user1" exists
  576. And user "user2" exists
  577. And As an "user0"
  578. And creating a share with
  579. | path | /textfile0.txt |
  580. | shareType | 0 |
  581. | shareWith | user1 |
  582. | permissions | 16 |
  583. And As an "user1"
  584. And accepting last share
  585. When creating a share with
  586. | path | /textfile0 (2).txt |
  587. | shareType | 0 |
  588. | shareWith | user2 |
  589. | permissions | 31 |
  590. Then the OCS status code should be "404"
  591. And the HTTP status code should be "200"
  592. Scenario: User is not allowed to reshare file with more permissions even if shares of same file to other users have them
  593. Given user "user0" exists
  594. And user "user1" exists
  595. And user "user2" exists
  596. And user "user3" exists
  597. And As an "user0"
  598. And creating a share with
  599. | path | /textfile0.txt |
  600. | shareType | 0 |
  601. | shareWith | user3 |
  602. | permissions | 15 |
  603. And As an "user3"
  604. And accepting last share
  605. And As an "user0"
  606. And creating a share with
  607. | path | /textfile0.txt |
  608. | shareType | 0 |
  609. | shareWith | user1 |
  610. | permissions | 17 |
  611. And As an "user1"
  612. And accepting last share
  613. When creating a share with
  614. | path | /textfile0 (2).txt |
  615. | shareType | 0 |
  616. | shareWith | user2 |
  617. | permissions | 19 |
  618. Then the OCS status code should be "404"
  619. And the HTTP status code should be "200"
  620. Scenario: User is not allowed to reshare file with more permissions even if shares of other files from same user have them
  621. Given user "user0" exists
  622. And user "user1" exists
  623. And user "user2" exists
  624. And As an "user0"
  625. And creating a share with
  626. | path | /textfile0.txt |
  627. | shareType | 0 |
  628. | shareWith | user1 |
  629. | permissions | 15 |
  630. And As an "user1"
  631. And accepting last share
  632. And As an "user0"
  633. And creating a share with
  634. | path | /textfile1.txt |
  635. | shareType | 0 |
  636. | shareWith | user1 |
  637. | permissions | 17 |
  638. And As an "user1"
  639. And accepting last share
  640. When creating a share with
  641. | path | /textfile1 (2).txt |
  642. | shareType | 0 |
  643. | shareWith | user2 |
  644. | permissions | 19 |
  645. Then the OCS status code should be "404"
  646. And the HTTP status code should be "200"
  647. Scenario: User is not allowed to reshare file with more permissions even if shares of other files from other users have them
  648. Given user "user0" exists
  649. And user "user1" exists
  650. And user "user2" exists
  651. And user "user3" exists
  652. And As an "user3"
  653. And creating a share with
  654. | path | /textfile0.txt |
  655. | shareType | 0 |
  656. | shareWith | user1 |
  657. | permissions | 15 |
  658. And As an "user1"
  659. And accepting last share
  660. And As an "user0"
  661. And creating a share with
  662. | path | /textfile1.txt |
  663. | shareType | 0 |
  664. | shareWith | user1 |
  665. | permissions | 17 |
  666. And As an "user1"
  667. And accepting last share
  668. When creating a share with
  669. | path | /textfile1 (2).txt |
  670. | shareType | 0 |
  671. | shareWith | user2 |
  672. | permissions | 19 |
  673. Then the OCS status code should be "404"
  674. And the HTTP status code should be "200"
  675. Scenario: User is not allowed to reshare file with additional delete permissions
  676. As an "admin"
  677. Given user "user0" exists
  678. And user "user1" exists
  679. And user "user2" exists
  680. And As an "user0"
  681. And creating a share with
  682. | path | /PARENT |
  683. | shareType | 0 |
  684. | shareWith | user1 |
  685. | permissions | 16 |
  686. And As an "user1"
  687. And accepting last share
  688. When creating a share with
  689. | path | /PARENT (2) |
  690. | shareType | 0 |
  691. | shareWith | user2 |
  692. | permissions | 25 |
  693. Then the OCS status code should be "404"
  694. And the HTTP status code should be "200"
  695. Scenario: User is not allowed to reshare file with additional delete permissions for files
  696. As an "admin"
  697. Given user "user0" exists
  698. And user "user1" exists
  699. And user "user2" exists
  700. And As an "user0"
  701. And creating a share with
  702. | path | /textfile0.txt |
  703. | shareType | 0 |
  704. | shareWith | user1 |
  705. | permissions | 16 |
  706. And As an "user1"
  707. And accepting last share
  708. When creating a share with
  709. | path | /textfile0 (2).txt |
  710. | shareType | 0 |
  711. | shareWith | user2 |
  712. | permissions | 25 |
  713. Then the OCS status code should be "100"
  714. And the HTTP status code should be "200"
  715. When Getting info of last share
  716. Then Share fields of last share match with
  717. | id | A_NUMBER |
  718. | item_type | file |
  719. | item_source | A_NUMBER |
  720. | share_type | 0 |
  721. | share_with | user2 |
  722. | file_source | A_NUMBER |
  723. | file_target | /textfile0 (2).txt |
  724. | path | /textfile0 (2).txt |
  725. | permissions | 17 |
  726. | stime | A_NUMBER |
  727. | storage | A_NUMBER |
  728. | mail_send | 0 |
  729. | uid_owner | user1 |
  730. | storage_id | shared::/textfile0 (2).txt |
  731. | file_parent | A_NUMBER |
  732. | share_with_displayname | user2 |
  733. | displayname_owner | user1 |
  734. | mimetype | text/plain |
  735. Scenario: Get a share with a user which didn't received the share
  736. Given user "user0" exists
  737. And user "user1" exists
  738. And user "user2" exists
  739. And file "textfile0.txt" of user "user0" is shared with user "user1"
  740. And As an "user2"
  741. When Getting info of last share
  742. Then the OCS status code should be "404"
  743. And the HTTP status code should be "200"
  744. Scenario: Get a share with a user with resharing rights
  745. Given user "user0" exists
  746. And user "user1" exists
  747. And user "user2" exists
  748. And file "textfile0.txt" of user "user0" is shared with user "user1"
  749. And user "user1" accepts last share
  750. And file "textfile0.txt" of user "user0" is shared with user "user2"
  751. And As an "user1"
  752. When Getting info of last share
  753. Then the OCS status code should be "100"
  754. And the HTTP status code should be "200"
  755. And Share fields of last share match with
  756. | id | A_NUMBER |
  757. | item_type | file |
  758. | item_source | A_NUMBER |
  759. | share_type | 0 |
  760. | share_with | user2 |
  761. | file_source | A_NUMBER |
  762. | file_target | /textfile0.txt |
  763. | path | /textfile0 (2).txt |
  764. | permissions | 19 |
  765. | stime | A_NUMBER |
  766. | storage | A_NUMBER |
  767. | mail_send | 0 |
  768. | uid_owner | user0 |
  769. | storage_id | shared::/textfile0 (2).txt |
  770. | file_parent | A_NUMBER |
  771. | share_with_displayname | user2 |
  772. | displayname_owner | user0 |
  773. | mimetype | text/plain |
  774. Scenario: Share of folder and sub-folder to same user - core#20645
  775. Given As an "admin"
  776. And user "user0" exists
  777. And user "user1" exists
  778. And group "group0" exists
  779. And user "user1" belongs to group "group0"
  780. And file "/PARENT" of user "user0" is shared with user "user1"
  781. And user "user1" accepts last share
  782. When file "/PARENT/CHILD" of user "user0" is shared with group "group0"
  783. And user "user1" accepts last share
  784. Then user "user1" should see following elements
  785. | /FOLDER/ |
  786. | /PARENT/ |
  787. | /PARENT/CHILD/ |
  788. | /PARENT/parent.txt |
  789. | /PARENT/CHILD/child.txt |
  790. | /PARENT%20(2)/ |
  791. | /PARENT%20(2)/CHILD/ |
  792. | /PARENT%20(2)/parent.txt |
  793. | /PARENT%20(2)/CHILD/child.txt |
  794. | /CHILD/ |
  795. | /CHILD/child.txt |
  796. And the HTTP status code should be "200"
  797. Scenario: Share a file by multiple channels
  798. Given As an "admin"
  799. And user "user0" exists
  800. And user "user1" exists
  801. And user "user2" exists
  802. And group "group0" exists
  803. And user "user1" belongs to group "group0"
  804. And user "user2" belongs to group "group0"
  805. And user "user0" created a folder "/common"
  806. And user "user0" created a folder "/common/sub"
  807. And file "common" of user "user0" is shared with group "group0"
  808. And user "user1" accepts last share
  809. And user "user2" accepts last share
  810. And file "textfile0.txt" of user "user1" is shared with user "user2"
  811. And user "user2" accepts last share
  812. And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
  813. And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
  814. And As an "user2"
  815. When Downloading file "/common/sub/textfile0.txt" with range "bytes=10-18"
  816. Then Downloaded content should be "test text"
  817. And Downloaded content when downloading file "/textfile0.txt" with range "bytes=10-18" should be "test text"
  818. And user "user2" should see following elements
  819. | /common/sub/textfile0.txt |
  820. Scenario: Share a file by multiple channels
  821. Given As an "admin"
  822. And user "user0" exists
  823. And user "user1" exists
  824. And user "user2" exists
  825. And group "group0" exists
  826. And user "user1" belongs to group "group0"
  827. And user "user2" belongs to group "group0"
  828. And user "user0" created a folder "/common"
  829. And user "user0" created a folder "/common/sub"
  830. And file "common" of user "user0" is shared with group "group0"
  831. And user "user1" accepts last share
  832. And user "user2" accepts last share
  833. And file "textfile0.txt" of user "user1" is shared with user "user2"
  834. And user "user2" accepts last share
  835. And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
  836. And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
  837. And As an "user2"
  838. When Downloading file "/textfile0 (2).txt" with range "bytes=10-18"
  839. Then Downloaded content should be "test text"
  840. And user "user2" should see following elements
  841. | /common/sub/textfile0.txt |
  842. Scenario: Delete all group shares
  843. Given As an "admin"
  844. And user "user0" exists
  845. And user "user1" exists
  846. And group "group1" exists
  847. And user "user1" belongs to group "group1"
  848. And file "textfile0.txt" of user "user0" is shared with group "group1"
  849. And user "user1" accepts last share
  850. And User "user1" moved file "/textfile0 (2).txt" to "/FOLDER/textfile0.txt"
  851. And As an "user0"
  852. And Deleting last share
  853. And As an "user1"
  854. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  855. Then the OCS status code should be "100"
  856. And the HTTP status code should be "200"
  857. And last share_id is not included in the answer
  858. Scenario: delete a share
  859. Given user "user0" exists
  860. And user "user1" exists
  861. And file "textfile0.txt" of user "user0" is shared with user "user1"
  862. And As an "user0"
  863. When Deleting last share
  864. Then the OCS status code should be "100"
  865. And the HTTP status code should be "200"
  866. Scenario: delete a share with a user that didn't receive the share
  867. Given user "user0" exists
  868. And user "user1" exists
  869. And user "user2" exists
  870. And file "textfile0.txt" of user "user0" is shared with user "user1"
  871. And As an "user2"
  872. When Deleting last share
  873. Then the OCS status code should be "404"
  874. And the HTTP status code should be "200"
  875. Scenario: delete a share with a user with resharing rights that didn't receive the share
  876. Given user "user0" exists
  877. And user "user1" exists
  878. And user "user2" exists
  879. And file "textfile0.txt" of user "user0" is shared with user "user1"
  880. And user "user1" accepts last share
  881. And file "textfile0.txt" of user "user0" is shared with user "user2"
  882. And As an "user1"
  883. When Deleting last share
  884. Then the OCS status code should be "403"
  885. And the HTTP status code should be "401"
  886. Scenario: Keep usergroup shares (#22143)
  887. Given As an "admin"
  888. And user "user0" exists
  889. And user "user1" exists
  890. And user "user2" exists
  891. And group "group" exists
  892. And user "user1" belongs to group "group"
  893. And user "user2" belongs to group "group"
  894. And user "user0" created a folder "/TMP"
  895. And file "TMP" of user "user0" is shared with group "group"
  896. And user "user1" accepts last share
  897. And user "user2" accepts last share
  898. And user "user1" created a folder "/myFOLDER"
  899. And User "user1" moves file "/TMP" to "/myFOLDER/myTMP"
  900. And user "user2" does not exist
  901. And user "user1" should see following elements
  902. | /myFOLDER/myTMP/ |
  903. Scenario: Check quota of owners parent directory of a shared file
  904. Given using old dav path
  905. And As an "admin"
  906. And user "user0" exists
  907. And user "user1" exists
  908. And user "user1" has a quota of "0"
  909. And User "user0" moved file "/welcome.txt" to "/myfile.txt"
  910. And file "myfile.txt" of user "user0" is shared with user "user1"
  911. And user "user1" accepts last share
  912. When User "user1" uploads file "data/textfile.txt" to "/myfile.txt"
  913. Then the HTTP status code should be "204"
  914. Scenario: Don't allow sharing of the root
  915. Given user "user0" exists
  916. And As an "user0"
  917. When creating a share with
  918. | path | / |
  919. | shareType | 3 |
  920. Then the OCS status code should be "403"
  921. Scenario: Allow modification of reshare
  922. Given user "user0" exists
  923. And user "user1" exists
  924. And user "user2" exists
  925. And user "user0" created a folder "/TMP"
  926. And file "TMP" of user "user0" is shared with user "user1"
  927. And user "user1" accepts last share
  928. And file "TMP" of user "user1" is shared with user "user2"
  929. And As an "user1"
  930. When Updating last share with
  931. | permissions | 1 |
  932. Then the OCS status code should be "100"
  933. And the HTTP status code should be "200"
  934. Scenario: Allow reshare to exceed permissions if shares of same file to same user have them
  935. Given user "user0" exists
  936. And user "user1" exists
  937. And user "user2" exists
  938. And group "group1" exists
  939. And user "user1" belongs to group "group1"
  940. And user "user0" created a folder "/TMP"
  941. And As an "user0"
  942. And creating a share with
  943. | path | /TMP |
  944. | shareType | 1 |
  945. | shareWith | group1 |
  946. | permissions | 15 |
  947. And As an "user1"
  948. And accepting last share
  949. And As an "user0"
  950. And creating a share with
  951. | path | /TMP |
  952. | shareType | 0 |
  953. | shareWith | user1 |
  954. | permissions | 17 |
  955. And As an "user1"
  956. And accepting last share
  957. And creating a share with
  958. | path | /TMP |
  959. | shareType | 0 |
  960. | shareWith | user2 |
  961. | permissions | 17 |
  962. When Updating last share with
  963. | permissions | 31 |
  964. Then the OCS status code should be "100"
  965. And the HTTP status code should be "200"
  966. Scenario: Do not allow reshare to exceed permissions
  967. Given user "user0" exists
  968. And user "user1" exists
  969. And user "user2" exists
  970. And user "user0" created a folder "/TMP"
  971. And As an "user0"
  972. And creating a share with
  973. | path | /TMP |
  974. | shareType | 0 |
  975. | shareWith | user1 |
  976. | permissions | 21 |
  977. And As an "user1"
  978. And accepting last share
  979. And creating a share with
  980. | path | /TMP |
  981. | shareType | 0 |
  982. | shareWith | user2 |
  983. | permissions | 21 |
  984. When Updating last share with
  985. | permissions | 31 |
  986. Then the OCS status code should be "404"
  987. And the HTTP status code should be "200"
  988. Scenario: Do not allow reshare to exceed permissions even if shares of same file to other users have them
  989. Given user "user0" exists
  990. And user "user1" exists
  991. And user "user2" exists
  992. And user "user3" exists
  993. And user "user0" created a folder "/TMP"
  994. And As an "user0"
  995. And creating a share with
  996. | path | /TMP |
  997. | shareType | 0 |
  998. | shareWith | user3 |
  999. | permissions | 15 |
  1000. And As an "user3"
  1001. And accepting last share
  1002. And As an "user0"
  1003. And creating a share with
  1004. | path | /TMP |
  1005. | shareType | 0 |
  1006. | shareWith | user1 |
  1007. | permissions | 21 |
  1008. And As an "user1"
  1009. And accepting last share
  1010. And creating a share with
  1011. | path | /TMP |
  1012. | shareType | 0 |
  1013. | shareWith | user2 |
  1014. | permissions | 21 |
  1015. When Updating last share with
  1016. | permissions | 31 |
  1017. Then the OCS status code should be "404"
  1018. And the HTTP status code should be "200"
  1019. Scenario: Do not allow reshare to exceed permissions even if shares of other files from same user have them
  1020. Given user "user0" exists
  1021. And user "user1" exists
  1022. And user "user2" exists
  1023. And As an "user0"
  1024. And creating a share with
  1025. | path | /FOLDER |
  1026. | shareType | 0 |
  1027. | shareWith | user1 |
  1028. | permissions | 15 |
  1029. And As an "user1"
  1030. And accepting last share
  1031. And user "user0" created a folder "/TMP"
  1032. And As an "user0"
  1033. And creating a share with
  1034. | path | /TMP |
  1035. | shareType | 0 |
  1036. | shareWith | user1 |
  1037. | permissions | 21 |
  1038. And As an "user1"
  1039. And accepting last share
  1040. And creating a share with
  1041. | path | /TMP |
  1042. | shareType | 0 |
  1043. | shareWith | user2 |
  1044. | permissions | 21 |
  1045. When Updating last share with
  1046. | permissions | 31 |
  1047. Then the OCS status code should be "404"
  1048. And the HTTP status code should be "200"
  1049. Scenario: Do not allow reshare to exceed permissions even if shares of other files from other users have them
  1050. Given user "user0" exists
  1051. And user "user1" exists
  1052. And user "user2" exists
  1053. And user "user3" exists
  1054. And As an "user3"
  1055. And creating a share with
  1056. | path | /FOLDER |
  1057. | shareType | 0 |
  1058. | shareWith | user1 |
  1059. | permissions | 15 |
  1060. And As an "user1"
  1061. And accepting last share
  1062. And user "user0" created a folder "/TMP"
  1063. And As an "user0"
  1064. And creating a share with
  1065. | path | /TMP |
  1066. | shareType | 0 |
  1067. | shareWith | user1 |
  1068. | permissions | 21 |
  1069. And As an "user1"
  1070. And accepting last share
  1071. And creating a share with
  1072. | path | /TMP |
  1073. | shareType | 0 |
  1074. | shareWith | user2 |
  1075. | permissions | 21 |
  1076. When Updating last share with
  1077. | permissions | 31 |
  1078. Then the OCS status code should be "404"
  1079. And the HTTP status code should be "200"
  1080. Scenario: Do not allow sub reshare to exceed permissions
  1081. Given user "user0" exists
  1082. And user "user1" exists
  1083. And user "user2" exists
  1084. And user "user0" created a folder "/TMP"
  1085. And user "user0" created a folder "/TMP/SUB"
  1086. And As an "user0"
  1087. And creating a share with
  1088. | path | /TMP |
  1089. | shareType | 0 |
  1090. | shareWith | user1 |
  1091. | permissions | 21 |
  1092. And As an "user1"
  1093. And accepting last share
  1094. And creating a share with
  1095. | path | /TMP/SUB |
  1096. | shareType | 0 |
  1097. | shareWith | user2 |
  1098. | permissions | 21 |
  1099. When Updating last share with
  1100. | permissions | 31 |
  1101. Then the OCS status code should be "404"
  1102. And the HTTP status code should be "200"
  1103. Scenario: Only allow 1 link share per file/folder
  1104. Given user "user0" exists
  1105. And As an "user0"
  1106. And creating a share with
  1107. | path | welcome.txt |
  1108. | shareType | 3 |
  1109. When save last share id
  1110. And creating a share with
  1111. | path | welcome.txt |
  1112. | shareType | 3 |
  1113. Then share ids should match
  1114. Scenario: Correct webdav share-permissions for owned file
  1115. Given user "user0" exists
  1116. And User "user0" uploads file with content "foo" to "/tmp.txt"
  1117. When as "user0" gets properties of folder "/tmp.txt" with
  1118. |{http://open-collaboration-services.org/ns}share-permissions |
  1119. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
  1120. # See sharing-v1-part3.feature