You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sharing-v1-part3.feature 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. # SPDX-FileCopyrightText: 20198 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-License-Identifier: AGPL-3.0-or-later
  3. Feature: sharing
  4. Background:
  5. Given using api version "1"
  6. Given using new dav path
  7. # See sharing-v1-part2.feature
  8. Scenario: Correct webdav share-permissions for received file with edit and reshare permissions
  9. Given user "user0" exists
  10. And user "user1" exists
  11. And User "user0" uploads file with content "foo" to "/tmp.txt"
  12. And file "/tmp.txt" of user "user0" is shared with user "user1"
  13. And user "user1" accepts last share
  14. When as "user1" gets properties of folder "/tmp.txt" with
  15. |{http://open-collaboration-services.org/ns}share-permissions |
  16. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
  17. Scenario: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
  18. Given user "user0" exists
  19. And user "user1" exists
  20. And User "user0" uploads file with content "foo" to "/tmp.txt"
  21. And file "tmp.txt" of user "user0" is shared with user "user1"
  22. And user "user1" accepts last share
  23. And As an "user0"
  24. And Updating last share with
  25. | permissions | 3 |
  26. When as "user1" gets properties of folder "/tmp.txt" with
  27. |{http://open-collaboration-services.org/ns}share-permissions |
  28. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"
  29. Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
  30. Given user "user0" exists
  31. And user "user1" exists
  32. And User "user0" uploads file with content "foo" to "/tmp.txt"
  33. And file "tmp.txt" of user "user0" is shared with user "user1"
  34. And user "user1" accepts last share
  35. And As an "user0"
  36. And Updating last share with
  37. | permissions | 17 |
  38. When as "user1" gets properties of folder "/tmp.txt" with
  39. |{http://open-collaboration-services.org/ns}share-permissions |
  40. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"
  41. Scenario: Correct webdav share-permissions for owned folder
  42. Given user "user0" exists
  43. And user "user0" created a folder "/tmp"
  44. When as "user0" gets properties of folder "/" with
  45. |{http://open-collaboration-services.org/ns}share-permissions |
  46. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
  47. Scenario: Correct webdav share-permissions for received folder with all permissions
  48. Given user "user0" exists
  49. And user "user1" exists
  50. And user "user0" created a folder "/tmp"
  51. And file "/tmp" of user "user0" is shared with user "user1"
  52. And user "user1" accepts last share
  53. When as "user1" gets properties of folder "/tmp" with
  54. |{http://open-collaboration-services.org/ns}share-permissions |
  55. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
  56. Scenario: Correct webdav share-permissions for received folder with all permissions but edit
  57. Given user "user0" exists
  58. And user "user1" exists
  59. And user "user0" created a folder "/tmp"
  60. And file "/tmp" of user "user0" is shared with user "user1"
  61. And user "user1" accepts last share
  62. And As an "user0"
  63. And Updating last share with
  64. | permissions | 29 |
  65. When as "user1" gets properties of folder "/tmp" with
  66. |{http://open-collaboration-services.org/ns}share-permissions |
  67. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"
  68. Scenario: Correct webdav share-permissions for received folder with all permissions but create
  69. Given user "user0" exists
  70. And user "user1" exists
  71. And user "user0" created a folder "/tmp"
  72. And file "/tmp" of user "user0" is shared with user "user1"
  73. And user "user1" accepts last share
  74. And As an "user0"
  75. And Updating last share with
  76. | permissions | 27 |
  77. When as "user1" gets properties of folder "/tmp" with
  78. |{http://open-collaboration-services.org/ns}share-permissions |
  79. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"
  80. Scenario: Correct webdav share-permissions for received folder with all permissions but delete
  81. Given user "user0" exists
  82. And user "user1" exists
  83. And user "user0" created a folder "/tmp"
  84. And file "/tmp" of user "user0" is shared with user "user1"
  85. And user "user1" accepts last share
  86. And As an "user0"
  87. And Updating last share with
  88. | permissions | 23 |
  89. When as "user1" gets properties of folder "/tmp" with
  90. |{http://open-collaboration-services.org/ns}share-permissions |
  91. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"
  92. Scenario: Correct webdav share-permissions for received folder with all permissions but share
  93. Given user "user0" exists
  94. And user "user1" exists
  95. And user "user0" created a folder "/tmp"
  96. And file "/tmp" of user "user0" is shared with user "user1"
  97. And user "user1" accepts last share
  98. And As an "user0"
  99. And Updating last share with
  100. | permissions | 15 |
  101. When as "user1" gets properties of folder "/tmp" with
  102. |{http://open-collaboration-services.org/ns}share-permissions |
  103. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"
  104. Scenario: unique target names for incoming shares
  105. Given user "user0" exists
  106. And user "user1" exists
  107. And user "user2" exists
  108. And user "user0" created a folder "/foo"
  109. And user "user1" created a folder "/foo"
  110. When file "/foo" of user "user0" is shared with user "user2"
  111. And user "user2" accepts last share
  112. And file "/foo" of user "user1" is shared with user "user2"
  113. And user "user2" accepts last share
  114. Then user "user2" should see following elements
  115. | /foo/ |
  116. | /foo%20(2)/ |
  117. Scenario: Creating a new share with a disabled user
  118. Given As an "admin"
  119. And user "user0" exists
  120. And user "user1" exists
  121. And assure user "user0" is disabled
  122. And As an "user0"
  123. When creating a share with
  124. | path | welcome.txt |
  125. | shareWith | user1 |
  126. | shareType | 0 |
  127. Then the OCS status code should be "997"
  128. And the HTTP status code should be "401"
  129. Scenario: Deleting a group share as its owner
  130. Given As an "admin"
  131. And user "user0" exists
  132. And user "user1" exists
  133. And group "group1" exists
  134. And user "user0" belongs to group "group1"
  135. And user "user1" belongs to group "group1"
  136. And As an "user0"
  137. And creating a share with
  138. | path | welcome.txt |
  139. | shareType | 1 |
  140. | shareWith | group1 |
  141. When As an "user0"
  142. And Deleting last share
  143. Then the OCS status code should be "100"
  144. And the HTTP status code should be "200"
  145. And Getting info of last share
  146. And the OCS status code should be "404"
  147. And the HTTP status code should be "200"
  148. And As an "user1"
  149. And Getting info of last share
  150. And the OCS status code should be "404"
  151. And the HTTP status code should be "200"
  152. Scenario: Deleting a group share as user
  153. Given As an "admin"
  154. And user "user0" exists
  155. And user "user1" exists
  156. And group "group1" exists
  157. And user "user1" belongs to group "group1"
  158. And As an "user0"
  159. And creating a share with
  160. | path | welcome.txt |
  161. | shareType | 1 |
  162. | shareWith | group1 |
  163. When As an "user1"
  164. And Deleting last share
  165. Then the OCS status code should be "100"
  166. And the HTTP status code should be "200"
  167. Scenario: Merging shares for recipient when shared from outside with group and member
  168. Given using old dav path
  169. And As an "admin"
  170. And user "user0" exists
  171. And user "user1" exists
  172. And group "group1" exists
  173. And user "user1" belongs to group "group1"
  174. And user "user0" created a folder "/merge-test-outside"
  175. When folder "/merge-test-outside" of user "user0" is shared with group "group1"
  176. And user "user1" accepts last share
  177. And folder "/merge-test-outside" of user "user0" is shared with user "user1"
  178. And user "user1" accepts last share
  179. Then as "user1" the folder "/merge-test-outside" exists
  180. And as "user1" the folder "/merge-test-outside (2)" does not exist
  181. Scenario: Merging shares for recipient when shared from outside with group and member with different permissions
  182. Given As an "admin"
  183. And user "user0" exists
  184. And user "user1" exists
  185. And group "group1" exists
  186. And user "user1" belongs to group "group1"
  187. And user "user0" created a folder "/merge-test-outside-perms"
  188. When folder "/merge-test-outside-perms" of user "user0" is shared with group "group1" with permissions 1
  189. And user "user1" accepts last share
  190. And folder "/merge-test-outside-perms" of user "user0" is shared with user "user1" with permissions 31
  191. And user "user1" accepts last share
  192. Then as "user1" gets properties of folder "/merge-test-outside-perms" with
  193. |{http://owncloud.org/ns}permissions|
  194. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRGDNVCK"
  195. And as "user1" the folder "/merge-test-outside-perms (2)" does not exist
  196. Scenario: Merging shares for recipient when shared from outside with two groups
  197. Given As an "admin"
  198. And user "user0" exists
  199. And user "user1" exists
  200. And group "group1" exists
  201. And group "group2" exists
  202. And user "user1" belongs to group "group1"
  203. And user "user1" belongs to group "group2"
  204. And user "user0" created a folder "/merge-test-outside-twogroups"
  205. When folder "/merge-test-outside-twogroups" of user "user0" is shared with group "group1"
  206. And user "user1" accepts last share
  207. And folder "/merge-test-outside-twogroups" of user "user0" is shared with group "group2"
  208. And user "user1" accepts last share
  209. Then as "user1" the folder "/merge-test-outside-twogroups" exists
  210. And as "user1" the folder "/merge-test-outside-twogroups (2)" does not exist
  211. Scenario: Merging shares for recipient when shared from outside with two groups with different permissions
  212. Given As an "admin"
  213. And user "user0" exists
  214. And user "user1" exists
  215. And group "group1" exists
  216. And group "group2" exists
  217. And user "user1" belongs to group "group1"
  218. And user "user1" belongs to group "group2"
  219. And user "user0" created a folder "/merge-test-outside-twogroups-perms"
  220. When folder "/merge-test-outside-twogroups-perms" of user "user0" is shared with group "group1" with permissions 1
  221. And user "user1" accepts last share
  222. And folder "/merge-test-outside-twogroups-perms" of user "user0" is shared with group "group2" with permissions 31
  223. And user "user1" accepts last share
  224. Then as "user1" gets properties of folder "/merge-test-outside-twogroups-perms" with
  225. |{http://owncloud.org/ns}permissions|
  226. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRGDNVCK"
  227. And as "user1" the folder "/merge-test-outside-twogroups-perms (2)" does not exist
  228. Scenario: Merging shares for recipient when shared from outside with two groups and member
  229. Given As an "admin"
  230. And user "user0" exists
  231. And user "user1" exists
  232. And group "group1" exists
  233. And group "group2" exists
  234. And user "user1" belongs to group "group1"
  235. And user "user1" belongs to group "group2"
  236. And user "user0" created a folder "/merge-test-outside-twogroups-member-perms"
  237. When folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group1" with permissions 1
  238. And user "user1" accepts last share
  239. And folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group2" with permissions 31
  240. And user "user1" accepts last share
  241. And folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with user "user1" with permissions 1
  242. And user "user1" accepts last share
  243. Then as "user1" gets properties of folder "/merge-test-outside-twogroups-member-perms" with
  244. |{http://owncloud.org/ns}permissions|
  245. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRGDNVCK"
  246. And as "user1" the folder "/merge-test-outside-twogroups-member-perms (2)" does not exist
  247. Scenario: Merging shares for recipient when shared from inside with group
  248. Given As an "admin"
  249. And user "user0" exists
  250. And group "group1" exists
  251. And user "user0" belongs to group "group1"
  252. And user "user0" created a folder "/merge-test-inside-group"
  253. When folder "/merge-test-inside-group" of user "user0" is shared with group "group1"
  254. Then as "user0" the folder "/merge-test-inside-group" exists
  255. And as "user0" the folder "/merge-test-inside-group (2)" does not exist
  256. Scenario: Merging shares for recipient when shared from inside with two groups
  257. Given As an "admin"
  258. And user "user0" exists
  259. And group "group1" exists
  260. And group "group2" exists
  261. And user "user0" belongs to group "group1"
  262. And user "user0" belongs to group "group2"
  263. And user "user0" created a folder "/merge-test-inside-twogroups"
  264. When folder "/merge-test-inside-twogroups" of user "user0" is shared with group "group1"
  265. And folder "/merge-test-inside-twogroups" of user "user0" is shared with group "group2"
  266. Then as "user0" the folder "/merge-test-inside-twogroups" exists
  267. And as "user0" the folder "/merge-test-inside-twogroups (2)" does not exist
  268. And as "user0" the folder "/merge-test-inside-twogroups (3)" does not exist
  269. Scenario: Merging shares for recipient when shared from inside with group with less permissions
  270. Given As an "admin"
  271. And user "user0" exists
  272. And group "group1" exists
  273. And group "group2" exists
  274. And user "user0" belongs to group "group1"
  275. And user "user0" belongs to group "group2"
  276. And user "user0" created a folder "/merge-test-inside-twogroups-perms"
  277. When folder "/merge-test-inside-twogroups-perms" of user "user0" is shared with group "group1"
  278. And folder "/merge-test-inside-twogroups-perms" of user "user0" is shared with group "group2"
  279. Then as "user0" gets properties of folder "/merge-test-inside-twogroups-perms" with
  280. |{http://owncloud.org/ns}permissions|
  281. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "RGDNVCK"
  282. And as "user0" the folder "/merge-test-inside-twogroups-perms (2)" does not exist
  283. And as "user0" the folder "/merge-test-inside-twogroups-perms (3)" does not exist
  284. Scenario: Merging shares for recipient when shared from outside with group then user and recipient renames in between
  285. Given As an "admin"
  286. And user "user0" exists
  287. And user "user1" exists
  288. And group "group1" exists
  289. And user "user1" belongs to group "group1"
  290. And user "user0" created a folder "/merge-test-outside-groups-renamebeforesecondshare"
  291. When folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
  292. And user "user1" accepts last share
  293. And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
  294. And Sleep for "1" seconds
  295. And folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
  296. And user "user1" accepts last share
  297. Then as "user1" gets properties of folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with
  298. |{http://owncloud.org/ns}permissions|
  299. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRGDNVCK"
  300. And as "user1" the folder "/merge-test-outside-groups-renamebeforesecondshare" does not exist
  301. Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between
  302. Given using old dav path
  303. Given As an "admin"
  304. And user "user0" exists
  305. And user "user1" exists
  306. And group "group1" exists
  307. And user "user1" belongs to group "group1"
  308. And user "user0" created a folder "/merge-test-outside-groups-renamebeforesecondshare"
  309. When folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
  310. And user "user1" accepts last share
  311. And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
  312. And Sleep for "1" seconds
  313. And folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
  314. And user "user1" accepts last share
  315. Then as "user1" gets properties of folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with
  316. |{http://owncloud.org/ns}permissions|
  317. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRGDNVCK"
  318. And as "user1" the folder "/merge-test-outside-groups-renamebeforesecondshare" does not exist
  319. Scenario: Empting trashbin
  320. Given As an "admin"
  321. And user "user0" exists
  322. And User "user0" deletes file "/textfile0.txt"
  323. When User "user0" empties trashbin
  324. Then the HTTP status code should be "204"
  325. Scenario: orphaned shares
  326. Given As an "admin"
  327. And user "user0" exists
  328. And user "user1" exists
  329. And user "user0" created a folder "/common"
  330. And user "user0" created a folder "/common/sub"
  331. And file "/common/sub" of user "user0" is shared with user "user1"
  332. And user "user1" accepts last share
  333. And User "user0" deletes folder "/common"
  334. When User "user0" empties trashbin
  335. Then as "user1" the folder "/sub" does not exist
  336. Scenario: sharing again an own file while belonging to a group
  337. Given As an "admin"
  338. Given user "user0" exists
  339. And group "sharing-group" exists
  340. And user "user0" belongs to group "sharing-group"
  341. And file "welcome.txt" of user "user0" is shared with group "sharing-group"
  342. And Deleting last share
  343. When creating a share with
  344. | path | welcome.txt |
  345. | shareWith | sharing-group |
  346. | shareType | 1 |
  347. Then the OCS status code should be "100"
  348. And the HTTP status code should be "200"
  349. Scenario: unshare from self
  350. Given As an "admin"
  351. And user "user0" exists
  352. And user "user1" exists
  353. And group "sharing-group" exists
  354. And user "user0" belongs to group "sharing-group"
  355. And user "user1" belongs to group "sharing-group"
  356. And file "/PARENT/parent.txt" of user "user0" is shared with group "sharing-group"
  357. And user "user1" accepts last share
  358. And user "user0" stores etag of element "/PARENT"
  359. And user "user1" stores etag of element "/"
  360. And As an "user1"
  361. When Deleting last share
  362. Then etag of element "/" of user "user1" has changed
  363. And etag of element "/PARENT" of user "user0" has not changed
  364. Scenario: do not allow to increase permissions on received share
  365. Given As an "admin"
  366. And user "user0" exists
  367. And user "user1" exists
  368. And user "user0" created a folder "/TMP"
  369. And As an "user0"
  370. And creating a share with
  371. | path | TMP |
  372. | shareType | 0 |
  373. | shareWith | user1 |
  374. | permissions | 17 |
  375. When As an "user1"
  376. And Updating last share with
  377. | permissions | 19 |
  378. Then the OCS status code should be "403"
  379. And the HTTP status code should be "200"
  380. Scenario: do not allow to increase permissions on non received share with user with resharing rights
  381. Given As an "admin"
  382. And user "user0" exists
  383. And user "user1" exists
  384. And user "user2" exists
  385. And user "user0" created a folder "/TMP"
  386. And As an "user0"
  387. And creating a share with
  388. | path | TMP |
  389. | shareType | 0 |
  390. | shareWith | user1 |
  391. | permissions | 31 |
  392. And user "user1" accepts last share
  393. And creating a share with
  394. | path | TMP |
  395. | shareType | 0 |
  396. | shareWith | user2 |
  397. | permissions | 17 |
  398. When As an "user1"
  399. And Updating last share with
  400. | permissions | 19 |
  401. Then the OCS status code should be "403"
  402. And the HTTP status code should be "200"
  403. Scenario: do not allow to increase link share permissions on reshare
  404. Given As an "admin"
  405. And user "user0" exists
  406. And user "user1" exists
  407. And user "user0" created a folder "/TMP"
  408. And As an "user0"
  409. And creating a share with
  410. | path | TMP |
  411. | shareType | 0 |
  412. | shareWith | user1 |
  413. | permissions | 17 |
  414. When As an "user1"
  415. And accepting last share
  416. And creating a share with
  417. | path | TMP |
  418. | shareType | 3 |
  419. And Updating last share with
  420. | publicUpload | true |
  421. Then the OCS status code should be "404"
  422. And the HTTP status code should be "200"
  423. Scenario: do not allow to increase link share permissions on sub reshare
  424. Given As an "admin"
  425. And user "user0" exists
  426. And user "user1" exists
  427. And user "user0" created a folder "/TMP"
  428. And user "user0" created a folder "/TMP/SUB"
  429. And As an "user0"
  430. And creating a share with
  431. | path | TMP |
  432. | shareType | 0 |
  433. | shareWith | user1 |
  434. | permissions | 17 |
  435. When As an "user1"
  436. And accepting last share
  437. And creating a share with
  438. | path | TMP/SUB |
  439. | shareType | 3 |
  440. And Updating last share with
  441. | publicUpload | true |
  442. Then the OCS status code should be "404"
  443. And the HTTP status code should be "200"
  444. Scenario: deleting file out of a share as recipient creates a backup for the owner
  445. Given As an "admin"
  446. And user "user0" exists
  447. And user "user1" exists
  448. And user "user0" created a folder "/shared"
  449. And User "user0" moved file "/textfile0.txt" to "/shared/shared_file.txt"
  450. And folder "/shared" of user "user0" is shared with user "user1"
  451. And user "user1" accepts last share
  452. When User "user1" deletes file "/shared/shared_file.txt"
  453. Then as "user1" the file "/shared/shared_file.txt" does not exist
  454. And as "user0" the file "/shared/shared_file.txt" does not exist
  455. And as "user0" the file "/shared_file.txt" exists in trash
  456. And as "user1" the file "/shared_file.txt" exists in trash
  457. Scenario: deleting folder out of a share as recipient creates a backup for the owner
  458. Given As an "admin"
  459. And user "user0" exists
  460. And user "user1" exists
  461. And user "user0" created a folder "/shared"
  462. And user "user0" created a folder "/shared/sub"
  463. And User "user0" moved file "/textfile0.txt" to "/shared/sub/shared_file.txt"
  464. And folder "/shared" of user "user0" is shared with user "user1"
  465. And user "user1" accepts last share
  466. When User "user1" deletes folder "/shared/sub"
  467. Then as "user1" the folder "/shared/sub" does not exist
  468. And as "user0" the folder "/shared/sub" does not exist
  469. And as "user0" the folder "/sub" exists in trash
  470. And as "user0" the file "/sub/shared_file.txt" exists in trash
  471. And as "user1" the folder "/sub" exists in trash
  472. And as "user1" the file "/sub/shared_file.txt" exists in trash
  473. Scenario: moving a file into a share as recipient
  474. Given As an "admin"
  475. And user "user0" exists
  476. And user "user1" exists
  477. And user "user0" created a folder "/shared"
  478. And folder "/shared" of user "user0" is shared with user "user1"
  479. And user "user1" accepts last share
  480. When User "user1" moved file "/textfile0.txt" to "/shared/shared_file.txt"
  481. Then as "user1" the file "/shared/shared_file.txt" exists
  482. And as "user0" the file "/shared/shared_file.txt" exists
  483. Scenario: receiving shares into a configured share_folder
  484. Given As an "admin"
  485. And invoking occ with "config:system:set share_folder --value received_shares"
  486. And user "user0" exists
  487. And user "user1" exists
  488. And user "user0" created a folder "/shared_folder"
  489. And User "user0" moved file "/textfile0.txt" to "/shared_file.txt"
  490. When folder "/shared_folder" of user "user0" is shared with user "user1"
  491. And user "user1" accepts last share
  492. Then as "user1" the file "/received_shares/shared_folder" exists
  493. When file "/shared_file.txt" of user "user0" is shared with user "user1"
  494. And user "user1" accepts last share
  495. Then as "user1" the file "/received_shares/shared_file.txt" exists
  496. Scenario: Owner of subshares is adjusted after moving into received share
  497. Given As an "admin"
  498. And user "user0" exists
  499. And user "user1" exists
  500. And user "user2" exists
  501. And user "user0" created a folder "/shared"
  502. And folder "/shared" of user "user0" is shared with user "user1"
  503. And user "user1" accepts last share
  504. And user "user1" created a folder "/movein"
  505. And user "user1" created a folder "/movein/subshare"
  506. When As an "user1"
  507. And folder "/movein" of user "user1" is shared with user "user2"
  508. And save last share id
  509. Then Getting info of last share
  510. And Share fields of last share match with
  511. | uid_file_owner | user1 |
  512. | share_with | user2 |
  513. When User "user1" moved file "/movein" to "/shared/movein"
  514. Then As an "user0"
  515. And Getting info of last share
  516. And Share fields of last share match with
  517. | uid_file_owner | user0 |
  518. | share_with | user2 |
  519. Scenario: Owner of subshares is adjusted after moving out of received share
  520. Given As an "admin"
  521. And user "user0" exists
  522. And user "user1" exists
  523. And user "user2" exists
  524. And user "user0" created a folder "/shared"
  525. And user "user0" created a folder "/shared/moveout"
  526. And user "user0" created a folder "/shared/moveout/subshare"
  527. And folder "/shared" of user "user0" is shared with user "user1"
  528. And user "user1" accepts last share
  529. And As an "user1"
  530. And folder "/shared/moveout/subshare" of user "user1" is shared with user "user2"
  531. And save last share id
  532. When As an "user1"
  533. Then Getting info of last share
  534. And Share fields of last share match with
  535. | uid_file_owner | user0 |
  536. | share_with | user2 |
  537. When User "user1" moved file "/shared/moveout" to "/moveout"
  538. Then Getting info of last share
  539. And Share fields of last share match with
  540. | uid_file_owner | user1 |
  541. | share_with | user2 |
  542. Scenario: Link shares inside of group shares keep their original data when the root share is updated
  543. Given As an "admin"
  544. And user "user0" exists
  545. And user "user1" exists
  546. And group "group1" exists
  547. And user "user1" belongs to group "group1"
  548. And As an "user0"
  549. And user "user0" created a folder "/share"
  550. And folder "/share" of user "user0" is shared with group "group1"
  551. And user "user1" accepts last share
  552. And user "user0" created a folder "/share/subfolder"
  553. And As an "user1"
  554. And save the last share data as "original"
  555. And as "user1" creating a share with
  556. | path | /share/subfolder |
  557. | shareType | 3 |
  558. | permissions | 31 |
  559. And save the last share data as "link"
  560. And As an "user0"
  561. And restore the last share data from "original"
  562. When Updating last share with
  563. | permissions | 23 |
  564. | expireDate | +3 days |
  565. And restore the last share data from "link"
  566. And Getting info of last share
  567. And Share fields of last share match with
  568. | id | A_NUMBER |
  569. | item_source | A_NUMBER |
  570. | share_type | 3 |
  571. | permissions | 23 |
  572. | file_target | /subfolder |
  573. | expireDate | |