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.feature 27KB

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