sharing-v1-part2.feature 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717
  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 file "textfile0 (2).txt" of user "user1" is shared with user "user2"
  13. And As an "user0"
  14. When sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=textfile0.txt"
  15. Then the OCS status code should be "100"
  16. And the HTTP status code should be "200"
  17. And User "user1" should be included in the response
  18. And User "user2" should be included in the response
  19. And User "user3" should not be included in the response
  20. Scenario: Reshared files can be still accessed if a user in the middle removes it.
  21. Given user "user0" exists
  22. And user "user1" exists
  23. And user "user2" exists
  24. And user "user3" exists
  25. And file "textfile0.txt" of user "user0" is shared with user "user1"
  26. And file "textfile0 (2).txt" of user "user1" is shared with user "user2"
  27. And file "textfile0 (2).txt" of user "user2" is shared with user "user3"
  28. And As an "user1"
  29. When User "user1" deletes file "/textfile0 (2).txt"
  30. And As an "user3"
  31. And Downloading file "/textfile0 (2).txt" with range "bytes=1-8"
  32. Then Downloaded content should be "extcloud"
  33. Scenario: getting share info of a share
  34. Given user "user0" exists
  35. And user "user1" exists
  36. And file "textfile0.txt" of user "user0" is shared with user "user1"
  37. And As an "user0"
  38. When Getting info of last share
  39. Then the OCS status code should be "100"
  40. And the HTTP status code should be "200"
  41. And Share fields of last share match with
  42. | id | A_NUMBER |
  43. | item_type | file |
  44. | item_source | A_NUMBER |
  45. | share_type | 0 |
  46. | share_with | user1 |
  47. | file_source | A_NUMBER |
  48. | file_target | /textfile0.txt |
  49. | path | /textfile0.txt |
  50. | permissions | 19 |
  51. | stime | A_NUMBER |
  52. | storage | A_NUMBER |
  53. | mail_send | 0 |
  54. | uid_owner | user0 |
  55. | storage_id | home::user0 |
  56. | file_parent | A_NUMBER |
  57. | share_with_displayname | user1 |
  58. | displayname_owner | user0 |
  59. | mimetype | text/plain |
  60. Scenario: keep group permissions in sync
  61. Given As an "admin"
  62. Given user "user0" exists
  63. And user "user1" exists
  64. And group "group1" exists
  65. And user "user1" belongs to group "group1"
  66. And file "textfile0.txt" of user "user0" is shared with group "group1"
  67. And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  68. And As an "user0"
  69. When Updating last share with
  70. | permissions | 1 |
  71. And Getting info of last share
  72. Then the OCS status code should be "100"
  73. And the HTTP status code should be "200"
  74. And Share fields of last share match with
  75. | id | A_NUMBER |
  76. | item_type | file |
  77. | item_source | A_NUMBER |
  78. | share_type | 1 |
  79. | file_source | A_NUMBER |
  80. | file_target | /textfile0.txt |
  81. | permissions | 1 |
  82. | stime | A_NUMBER |
  83. | storage | A_NUMBER |
  84. | mail_send | 0 |
  85. | uid_owner | user0 |
  86. | storage_id | home::user0 |
  87. | file_parent | A_NUMBER |
  88. | displayname_owner | user0 |
  89. | mimetype | text/plain |
  90. Scenario: Sharee can see the share
  91. Given user "user0" exists
  92. And user "user1" exists
  93. And file "textfile0.txt" of user "user0" is shared with user "user1"
  94. And As an "user1"
  95. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  96. Then the OCS status code should be "100"
  97. And the HTTP status code should be "200"
  98. And last share_id is included in the answer
  99. Scenario: Sharee can see the filtered share
  100. Given user "user0" exists
  101. And user "user1" exists
  102. And file "textfile0.txt" of user "user0" is shared with user "user1"
  103. And file "textfile1.txt" of user "user0" is shared with user "user1"
  104. And As an "user1"
  105. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true&path=textfile1 (2).txt"
  106. Then the OCS status code should be "100"
  107. And the HTTP status code should be "200"
  108. And last share_id is included in the answer
  109. Scenario: Sharee can't see the share that is filtered out
  110. Given user "user0" exists
  111. And user "user1" exists
  112. And file "textfile0.txt" of user "user0" is shared with user "user1"
  113. And file "textfile1.txt" of user "user0" is shared with user "user1"
  114. And As an "user1"
  115. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true&path=textfile0 (2).txt"
  116. Then the OCS status code should be "100"
  117. And the HTTP status code should be "200"
  118. And last share_id is not included in the answer
  119. Scenario: Sharee can see the group share
  120. Given As an "admin"
  121. And user "user0" exists
  122. And user "user1" exists
  123. And group "group0" exists
  124. And user "user1" belongs to group "group0"
  125. And file "textfile0.txt" of user "user0" is shared with group "group0"
  126. And As an "user1"
  127. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  128. Then the OCS status code should be "100"
  129. And the HTTP status code should be "200"
  130. And last share_id is included in the answer
  131. Scenario: User is not allowed to reshare file
  132. As an "admin"
  133. Given user "user0" exists
  134. And user "user1" exists
  135. And user "user2" exists
  136. And As an "user0"
  137. And creating a share with
  138. | path | /textfile0.txt |
  139. | shareType | 0 |
  140. | shareWith | user1 |
  141. | permissions | 8 |
  142. And As an "user1"
  143. When creating a share with
  144. | path | /textfile0 (2).txt |
  145. | shareType | 0 |
  146. | shareWith | user2 |
  147. | permissions | 31 |
  148. Then the OCS status code should be "404"
  149. And the HTTP status code should be "200"
  150. Scenario: User is not allowed to reshare file with more permissions
  151. As an "admin"
  152. Given user "user0" exists
  153. And user "user1" exists
  154. And user "user2" exists
  155. And As an "user0"
  156. And creating a share with
  157. | path | /textfile0.txt |
  158. | shareType | 0 |
  159. | shareWith | user1 |
  160. | permissions | 16 |
  161. And As an "user1"
  162. When creating a share with
  163. | path | /textfile0 (2).txt |
  164. | shareType | 0 |
  165. | shareWith | user2 |
  166. | permissions | 31 |
  167. Then the OCS status code should be "404"
  168. And the HTTP status code should be "200"
  169. Scenario: Get a share with a user which didn't received the share
  170. Given user "user0" exists
  171. And user "user1" exists
  172. And user "user2" exists
  173. And file "textfile0.txt" of user "user0" is shared with user "user1"
  174. And As an "user2"
  175. When Getting info of last share
  176. Then the OCS status code should be "404"
  177. And the HTTP status code should be "200"
  178. Scenario: Share of folder and sub-folder to same user - core#20645
  179. Given As an "admin"
  180. And user "user0" exists
  181. And user "user1" exists
  182. And group "group0" exists
  183. And user "user1" belongs to group "group0"
  184. And file "/PARENT" of user "user0" is shared with user "user1"
  185. When file "/PARENT/CHILD" of user "user0" is shared with group "group0"
  186. Then user "user1" should see following elements
  187. | /FOLDER/ |
  188. | /PARENT/ |
  189. | /CHILD/ |
  190. | /PARENT/parent.txt |
  191. | /CHILD/child.txt |
  192. And the HTTP status code should be "200"
  193. Scenario: Share a file by multiple channels
  194. Given As an "admin"
  195. And user "user0" exists
  196. And user "user1" exists
  197. And user "user2" exists
  198. And group "group0" exists
  199. And user "user1" belongs to group "group0"
  200. And user "user2" belongs to group "group0"
  201. And user "user0" created a folder "/common"
  202. And user "user0" created a folder "/common/sub"
  203. And file "common" of user "user0" is shared with group "group0"
  204. And file "textfile0.txt" of user "user1" is shared with user "user2"
  205. And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
  206. And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
  207. And As an "user2"
  208. When Downloading file "/common/sub/textfile0.txt" with range "bytes=10-18"
  209. Then Downloaded content should be "test text"
  210. And Downloaded content when downloading file "/textfile0.txt" with range "bytes=10-18" should be "test text"
  211. And user "user2" should see following elements
  212. | /common/sub/textfile0.txt |
  213. Scenario: Share a file by multiple channels
  214. Given As an "admin"
  215. And user "user0" exists
  216. And user "user1" exists
  217. And user "user2" exists
  218. And group "group0" exists
  219. And user "user1" belongs to group "group0"
  220. And user "user2" belongs to group "group0"
  221. And user "user0" created a folder "/common"
  222. And user "user0" created a folder "/common/sub"
  223. And file "common" of user "user0" is shared with group "group0"
  224. And file "textfile0.txt" of user "user1" is shared with user "user2"
  225. And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
  226. And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
  227. And As an "user2"
  228. When Downloading file "/textfile0.txt" with range "bytes=10-18"
  229. Then Downloaded content should be "test text"
  230. And user "user2" should see following elements
  231. | /common/sub/textfile0.txt |
  232. Scenario: Delete all group shares
  233. Given As an "admin"
  234. And user "user0" exists
  235. And user "user1" exists
  236. And group "group1" exists
  237. And user "user1" belongs to group "group1"
  238. And file "textfile0.txt" of user "user0" is shared with group "group1"
  239. And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  240. And As an "user0"
  241. And Deleting last share
  242. And As an "user1"
  243. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  244. Then the OCS status code should be "100"
  245. And the HTTP status code should be "200"
  246. And last share_id is not included in the answer
  247. Scenario: delete a share
  248. Given user "user0" exists
  249. And user "user1" exists
  250. And file "textfile0.txt" of user "user0" is shared with user "user1"
  251. And As an "user0"
  252. When Deleting last share
  253. Then the OCS status code should be "100"
  254. And the HTTP status code should be "200"
  255. Scenario: Keep usergroup shares (#22143)
  256. Given As an "admin"
  257. And user "user0" exists
  258. And user "user1" exists
  259. And user "user2" exists
  260. And group "group" exists
  261. And user "user1" belongs to group "group"
  262. And user "user2" belongs to group "group"
  263. And user "user0" created a folder "/TMP"
  264. And file "TMP" of user "user0" is shared with group "group"
  265. And user "user1" created a folder "/myFOLDER"
  266. And User "user1" moves file "/TMP" to "/myFOLDER/myTMP"
  267. And user "user2" does not exist
  268. And user "user1" should see following elements
  269. | /myFOLDER/myTMP/ |
  270. Scenario: Check quota of owners parent directory of a shared file
  271. Given using old dav path
  272. And As an "admin"
  273. And user "user0" exists
  274. And user "user1" exists
  275. And user "user1" has a quota of "0"
  276. And User "user0" moved file "/welcome.txt" to "/myfile.txt"
  277. And file "myfile.txt" of user "user0" is shared with user "user1"
  278. When User "user1" uploads file "data/textfile.txt" to "/myfile.txt"
  279. Then the HTTP status code should be "204"
  280. Scenario: Don't allow sharing of the root
  281. Given user "user0" exists
  282. And As an "user0"
  283. When creating a share with
  284. | path | / |
  285. | shareType | 3 |
  286. Then the OCS status code should be "403"
  287. Scenario: Allow modification of reshare
  288. Given user "user0" exists
  289. And user "user1" exists
  290. And user "user2" exists
  291. And user "user0" created a folder "/TMP"
  292. And file "TMP" of user "user0" is shared with user "user1"
  293. And file "TMP" of user "user1" is shared with user "user2"
  294. And As an "user1"
  295. When Updating last share with
  296. | permissions | 1 |
  297. Then the OCS status code should be "100"
  298. Scenario: Do not allow reshare to exceed permissions
  299. Given user "user0" exists
  300. And user "user1" exists
  301. And user "user2" exists
  302. And user "user0" created a folder "/TMP"
  303. And As an "user0"
  304. And creating a share with
  305. | path | /TMP |
  306. | shareType | 0 |
  307. | shareWith | user1 |
  308. | permissions | 21 |
  309. And As an "user1"
  310. And creating a share with
  311. | path | /TMP |
  312. | shareType | 0 |
  313. | shareWith | user2 |
  314. | permissions | 21 |
  315. When Updating last share with
  316. | permissions | 31 |
  317. Then the OCS status code should be "404"
  318. Scenario: Only allow 1 link share per file/folder
  319. Given user "user0" exists
  320. And As an "user0"
  321. And creating a share with
  322. | path | welcome.txt |
  323. | shareType | 3 |
  324. When save last share id
  325. And creating a share with
  326. | path | welcome.txt |
  327. | shareType | 3 |
  328. Then share ids should match
  329. Scenario: Correct webdav share-permissions for owned file
  330. Given user "user0" exists
  331. And User "user0" uploads file with content "foo" to "/tmp.txt"
  332. When as "user0" gets properties of folder "/tmp.txt" with
  333. |{http://open-collaboration-services.org/ns}share-permissions |
  334. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
  335. Scenario: Correct webdav share-permissions for received file with edit and reshare permissions
  336. Given user "user0" exists
  337. And user "user1" exists
  338. And User "user0" uploads file with content "foo" to "/tmp.txt"
  339. And file "/tmp.txt" of user "user0" is shared with user "user1"
  340. When as "user1" gets properties of folder "/tmp.txt" with
  341. |{http://open-collaboration-services.org/ns}share-permissions |
  342. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
  343. Scenario: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
  344. Given user "user0" exists
  345. And user "user1" exists
  346. And User "user0" uploads file with content "foo" to "/tmp.txt"
  347. And file "tmp.txt" of user "user0" is shared with user "user1"
  348. And As an "user0"
  349. And Updating last share with
  350. | permissions | 3 |
  351. When as "user1" gets properties of folder "/tmp.txt" with
  352. |{http://open-collaboration-services.org/ns}share-permissions |
  353. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"
  354. Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
  355. Given user "user0" exists
  356. And user "user1" exists
  357. And User "user0" uploads file with content "foo" to "/tmp.txt"
  358. And file "tmp.txt" of user "user0" is shared with user "user1"
  359. And As an "user0"
  360. And Updating last share with
  361. | permissions | 17 |
  362. When as "user1" gets properties of folder "/tmp.txt" with
  363. |{http://open-collaboration-services.org/ns}share-permissions |
  364. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"
  365. Scenario: Correct webdav share-permissions for owned folder
  366. Given user "user0" exists
  367. And user "user0" created a folder "/tmp"
  368. When as "user0" gets properties of folder "/" with
  369. |{http://open-collaboration-services.org/ns}share-permissions |
  370. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
  371. Scenario: Correct webdav share-permissions for received folder with all permissions
  372. Given user "user0" exists
  373. And user "user1" exists
  374. And user "user0" created a folder "/tmp"
  375. And file "/tmp" of user "user0" is shared with user "user1"
  376. When as "user1" gets properties of folder "/tmp" with
  377. |{http://open-collaboration-services.org/ns}share-permissions |
  378. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
  379. Scenario: Correct webdav share-permissions for received folder with all permissions but edit
  380. Given user "user0" exists
  381. And user "user1" exists
  382. And user "user0" created a folder "/tmp"
  383. And file "/tmp" of user "user0" is shared with user "user1"
  384. And As an "user0"
  385. And Updating last share with
  386. | permissions | 29 |
  387. When as "user1" gets properties of folder "/tmp" with
  388. |{http://open-collaboration-services.org/ns}share-permissions |
  389. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"
  390. Scenario: Correct webdav share-permissions for received folder with all permissions but create
  391. Given user "user0" exists
  392. And user "user1" exists
  393. And user "user0" created a folder "/tmp"
  394. And file "/tmp" of user "user0" is shared with user "user1"
  395. And As an "user0"
  396. And Updating last share with
  397. | permissions | 27 |
  398. When as "user1" gets properties of folder "/tmp" with
  399. |{http://open-collaboration-services.org/ns}share-permissions |
  400. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"
  401. Scenario: Correct webdav share-permissions for received folder with all permissions but delete
  402. Given user "user0" exists
  403. And user "user1" exists
  404. And user "user0" created a folder "/tmp"
  405. And file "/tmp" of user "user0" is shared with user "user1"
  406. And As an "user0"
  407. And Updating last share with
  408. | permissions | 23 |
  409. When as "user1" gets properties of folder "/tmp" with
  410. |{http://open-collaboration-services.org/ns}share-permissions |
  411. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"
  412. Scenario: Correct webdav share-permissions for received folder with all permissions but share
  413. Given user "user0" exists
  414. And user "user1" exists
  415. And user "user0" created a folder "/tmp"
  416. And file "/tmp" of user "user0" is shared with user "user1"
  417. And As an "user0"
  418. And Updating last share with
  419. | permissions | 15 |
  420. When as "user1" gets properties of folder "/tmp" with
  421. |{http://open-collaboration-services.org/ns}share-permissions |
  422. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"
  423. Scenario: unique target names for incoming shares
  424. Given user "user0" exists
  425. And user "user1" exists
  426. And user "user2" exists
  427. And user "user0" created a folder "/foo"
  428. And user "user1" created a folder "/foo"
  429. When file "/foo" of user "user0" is shared with user "user2"
  430. And file "/foo" of user "user1" is shared with user "user2"
  431. Then user "user2" should see following elements
  432. | /foo/ |
  433. | /foo%20(2)/ |
  434. Scenario: Creating a new share with a disabled user
  435. Given As an "admin"
  436. And user "user0" exists
  437. And user "user1" exists
  438. And assure user "user0" is disabled
  439. And As an "user0"
  440. When sending "POST" to "/apps/files_sharing/api/v1/shares" with
  441. | path | welcome.txt |
  442. | shareWith | user1 |
  443. | shareType | 0 |
  444. Then the OCS status code should be "997"
  445. And the HTTP status code should be "401"
  446. Scenario: Deleting a group share as user
  447. Given As an "admin"
  448. And user "user0" exists
  449. And user "user1" exists
  450. And group "group1" exists
  451. And user "user1" belongs to group "group1"
  452. And As an "user0"
  453. And creating a share with
  454. | path | welcome.txt |
  455. | shareType | 1 |
  456. | shareWith | group1 |
  457. When As an "user1"
  458. And Deleting last share
  459. Then the OCS status code should be "100"
  460. And the HTTP status code should be "200"
  461. Scenario: Merging shares for recipient when shared from outside with group and member
  462. Given using old dav path
  463. And As an "admin"
  464. And user "user0" exists
  465. And user "user1" exists
  466. And group "group1" exists
  467. And user "user1" belongs to group "group1"
  468. And user "user0" created a folder "/merge-test-outside"
  469. When folder "/merge-test-outside" of user "user0" is shared with group "group1"
  470. And folder "/merge-test-outside" of user "user0" is shared with user "user1"
  471. Then as "user1" the folder "/merge-test-outside" exists
  472. And as "user1" the folder "/merge-test-outside (2)" does not exist
  473. Scenario: Merging shares for recipient when shared from outside with group and member with different permissions
  474. Given As an "admin"
  475. And user "user0" exists
  476. And user "user1" exists
  477. And group "group1" exists
  478. And user "user1" belongs to group "group1"
  479. And user "user0" created a folder "/merge-test-outside-perms"
  480. When folder "/merge-test-outside-perms" of user "user0" is shared with group "group1" with permissions 1
  481. And folder "/merge-test-outside-perms" of user "user0" is shared with user "user1" with permissions 31
  482. Then as "user1" gets properties of folder "/merge-test-outside-perms" with
  483. |{http://owncloud.org/ns}permissions|
  484. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  485. And as "user1" the folder "/merge-test-outside-perms (2)" does not exist
  486. Scenario: Merging shares for recipient when shared from outside with two groups
  487. Given As an "admin"
  488. And user "user0" exists
  489. And user "user1" exists
  490. And group "group1" exists
  491. And group "group2" exists
  492. And user "user1" belongs to group "group1"
  493. And user "user1" belongs to group "group2"
  494. And user "user0" created a folder "/merge-test-outside-twogroups"
  495. When folder "/merge-test-outside-twogroups" of user "user0" is shared with group "group1"
  496. And folder "/merge-test-outside-twogroups" of user "user0" is shared with group "group2"
  497. Then as "user1" the folder "/merge-test-outside-twogroups" exists
  498. And as "user1" the folder "/merge-test-outside-twogroups (2)" does not exist
  499. Scenario: Merging shares for recipient when shared from outside with two groups with different permissions
  500. Given As an "admin"
  501. And user "user0" exists
  502. And user "user1" exists
  503. And group "group1" exists
  504. And group "group2" exists
  505. And user "user1" belongs to group "group1"
  506. And user "user1" belongs to group "group2"
  507. And user "user0" created a folder "/merge-test-outside-twogroups-perms"
  508. When folder "/merge-test-outside-twogroups-perms" of user "user0" is shared with group "group1" with permissions 1
  509. And folder "/merge-test-outside-twogroups-perms" of user "user0" is shared with group "group2" with permissions 31
  510. Then as "user1" gets properties of folder "/merge-test-outside-twogroups-perms" with
  511. |{http://owncloud.org/ns}permissions|
  512. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  513. And as "user1" the folder "/merge-test-outside-twogroups-perms (2)" does not exist
  514. Scenario: Merging shares for recipient when shared from outside with two groups and member
  515. Given As an "admin"
  516. And user "user0" exists
  517. And user "user1" exists
  518. And group "group1" exists
  519. And group "group2" exists
  520. And user "user1" belongs to group "group1"
  521. And user "user1" belongs to group "group2"
  522. And user "user0" created a folder "/merge-test-outside-twogroups-member-perms"
  523. When folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group1" with permissions 1
  524. And folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group2" with permissions 31
  525. And folder "/merge-test-outside-twogroups-member-perms" of user "user0" is shared with user "user1" with permissions 1
  526. Then as "user1" gets properties of folder "/merge-test-outside-twogroups-member-perms" with
  527. |{http://owncloud.org/ns}permissions|
  528. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  529. And as "user1" the folder "/merge-test-outside-twogroups-member-perms (2)" does not exist
  530. Scenario: Merging shares for recipient when shared from inside with group
  531. Given As an "admin"
  532. And user "user0" exists
  533. And group "group1" exists
  534. And user "user0" belongs to group "group1"
  535. And user "user0" created a folder "/merge-test-inside-group"
  536. When folder "/merge-test-inside-group" of user "user0" is shared with group "group1"
  537. Then as "user0" the folder "/merge-test-inside-group" exists
  538. And as "user0" the folder "/merge-test-inside-group (2)" does not exist
  539. Scenario: Merging shares for recipient when shared from inside with two groups
  540. Given As an "admin"
  541. And user "user0" exists
  542. And group "group1" exists
  543. And group "group2" exists
  544. And user "user0" belongs to group "group1"
  545. And user "user0" belongs to group "group2"
  546. And user "user0" created a folder "/merge-test-inside-twogroups"
  547. When folder "/merge-test-inside-twogroups" of user "user0" is shared with group "group1"
  548. And folder "/merge-test-inside-twogroups" of user "user0" is shared with group "group2"
  549. Then as "user0" the folder "/merge-test-inside-twogroups" exists
  550. And as "user0" the folder "/merge-test-inside-twogroups (2)" does not exist
  551. And as "user0" the folder "/merge-test-inside-twogroups (3)" does not exist
  552. Scenario: Merging shares for recipient when shared from inside with group with less permissions
  553. Given As an "admin"
  554. And user "user0" exists
  555. And group "group1" exists
  556. And group "group2" exists
  557. And user "user0" belongs to group "group1"
  558. And user "user0" belongs to group "group2"
  559. And user "user0" created a folder "/merge-test-inside-twogroups-perms"
  560. When folder "/merge-test-inside-twogroups-perms" of user "user0" is shared with group "group1"
  561. And folder "/merge-test-inside-twogroups-perms" of user "user0" is shared with group "group2"
  562. Then as "user0" gets properties of folder "/merge-test-inside-twogroups-perms" with
  563. |{http://owncloud.org/ns}permissions|
  564. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "RDNVCK"
  565. And as "user0" the folder "/merge-test-inside-twogroups-perms (2)" does not exist
  566. And as "user0" the folder "/merge-test-inside-twogroups-perms (3)" does not exist
  567. Scenario: Merging shares for recipient when shared from outside with group then user and recipient renames in between
  568. Given As an "admin"
  569. And user "user0" exists
  570. And user "user1" exists
  571. And group "group1" exists
  572. And user "user1" belongs to group "group1"
  573. And user "user0" created a folder "/merge-test-outside-groups-renamebeforesecondshare"
  574. When folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
  575. And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
  576. And Sleep for "1" seconds
  577. And folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
  578. Then as "user1" gets properties of folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with
  579. |{http://owncloud.org/ns}permissions|
  580. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  581. And as "user1" the folder "/merge-test-outside-groups-renamebeforesecondshare" does not exist
  582. Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between
  583. Given using old dav path
  584. Given As an "admin"
  585. And user "user0" exists
  586. And user "user1" exists
  587. And group "group1" exists
  588. And user "user1" belongs to group "group1"
  589. And user "user0" created a folder "/merge-test-outside-groups-renamebeforesecondshare"
  590. When folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
  591. And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
  592. And Sleep for "1" seconds
  593. And folder "/merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
  594. Then as "user1" gets properties of folder "/merge-test-outside-groups-renamebeforesecondshare-renamed" with
  595. |{http://owncloud.org/ns}permissions|
  596. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  597. And as "user1" the folder "/merge-test-outside-groups-renamebeforesecondshare" does not exist
  598. Scenario: Empting trashbin
  599. Given As an "admin"
  600. And user "user0" exists
  601. And User "user0" deletes file "/textfile0.txt"
  602. When User "user0" empties trashbin
  603. Then the HTTP status code should be "200"
  604. Scenario: orphaned shares
  605. Given As an "admin"
  606. And user "user0" exists
  607. And user "user1" exists
  608. And user "user0" created a folder "/common"
  609. And user "user0" created a folder "/common/sub"
  610. And file "/common/sub" of user "user0" is shared with user "user1"
  611. And User "user0" deletes folder "/common"
  612. When User "user0" empties trashbin
  613. Then as "user1" the folder "/sub" does not exist
  614. Scenario: sharing again an own file while belonging to a group
  615. Given As an "admin"
  616. Given user "user0" exists
  617. And group "sharing-group" exists
  618. And user "user0" belongs to group "sharing-group"
  619. And file "welcome.txt" of user "user0" is shared with group "sharing-group"
  620. And Deleting last share
  621. When sending "POST" to "/apps/files_sharing/api/v1/shares" with
  622. | path | welcome.txt |
  623. | shareWith | sharing-group |
  624. | shareType | 1 |
  625. Then the OCS status code should be "100"
  626. And the HTTP status code should be "200"
  627. Scenario: unshare from self
  628. Given As an "admin"
  629. And user "user0" exists
  630. And user "user1" exists
  631. And group "sharing-group" exists
  632. And user "user0" belongs to group "sharing-group"
  633. And user "user1" belongs to group "sharing-group"
  634. And file "/PARENT/parent.txt" of user "user0" is shared with group "sharing-group"
  635. And user "user0" stores etag of element "/PARENT"
  636. And user "user1" stores etag of element "/"
  637. And As an "user1"
  638. When Deleting last share
  639. Then etag of element "/" of user "user1" has changed
  640. And etag of element "/PARENT" of user "user0" has not changed
  641. Scenario: do not allow to increase link share permissions on reshare
  642. Given As an "admin"
  643. And user "admin" created a folder "/TMP"
  644. And user "user0" exists
  645. And creating a share with
  646. | path | TMP |
  647. | shareType | 0 |
  648. | shareWith | user0 |
  649. | permissions | 17 |
  650. When As an "user0"
  651. And creating a share with
  652. | path | TMP |
  653. | shareType | 3 |
  654. And Updating last share with
  655. | publicUpload | true |
  656. Then the OCS status code should be "404"
  657. Scenario: moving a file into a share as recipient
  658. Given As an "admin"
  659. And user "user0" exists
  660. And user "user1" exists
  661. And user "user0" created a folder "/shared"
  662. And folder "/shared" of user "user0" is shared with user "user1"
  663. When User "user1" moved file "/textfile0.txt" to "/shared/shared_file.txt"
  664. Then as "user1" the file "/shared/shared_file.txt" exists
  665. And as "user0" the file "/shared/shared_file.txt" exists