sharing-v1.feature 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  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 share with user who already received a share through their group
  27. Given As an "admin"
  28. And user "user0" exists
  29. And user "user1" exists
  30. And group "sharing-group" exists
  31. And user "user1" belongs to group "sharing-group"
  32. And file "welcome.txt" of user "user0" is shared with group "sharing-group"
  33. And As an "user0"
  34. Then sending "POST" to "/apps/files_sharing/api/v1/shares" with
  35. | path | welcome.txt |
  36. | shareWith | user1 |
  37. | shareType | 0 |
  38. Then the OCS status code should be "100"
  39. And the HTTP status code should be "200"
  40. Scenario: Creating a new public share
  41. Given user "user0" exists
  42. And As an "user0"
  43. When creating a share with
  44. | path | welcome.txt |
  45. | shareType | 3 |
  46. Then the OCS status code should be "100"
  47. And the HTTP status code should be "200"
  48. And Public shared file "welcome.txt" can be downloaded
  49. Scenario: Creating a new public share with password
  50. Given user "user0" exists
  51. And As an "user0"
  52. When creating a share with
  53. | path | welcome.txt |
  54. | shareType | 3 |
  55. | password | publicpw |
  56. Then the OCS status code should be "100"
  57. And the HTTP status code should be "200"
  58. And Public shared file "welcome.txt" with password "publicpw" can be downloaded
  59. Scenario: Creating a new public share of a folder
  60. Given user "user0" exists
  61. And As an "user0"
  62. When creating a share with
  63. | path | FOLDER |
  64. | shareType | 3 |
  65. | password | publicpw |
  66. | expireDate | +3 days |
  67. | publicUpload | true |
  68. | permissions | 7 |
  69. Then the OCS status code should be "100"
  70. And the HTTP status code should be "200"
  71. And Share fields of last share match with
  72. | id | A_NUMBER |
  73. | permissions | 15 |
  74. | expiration | +3 days |
  75. | url | AN_URL |
  76. | token | A_TOKEN |
  77. | mimetype | httpd/unix-directory |
  78. Scenario: Creating a new public share with password and adding an expiration date
  79. Given user "user0" exists
  80. And As an "user0"
  81. When creating a share with
  82. | path | welcome.txt |
  83. | shareType | 3 |
  84. | password | publicpw |
  85. And Updating last share with
  86. | expireDate | +3 days |
  87. Then the OCS status code should be "100"
  88. And the HTTP status code should be "200"
  89. And Public shared file "welcome.txt" with password "publicpw" can be downloaded
  90. Scenario: Creating a new public share, updating its expiration date and getting its info
  91. Given user "user0" exists
  92. And As an "user0"
  93. When creating a share with
  94. | path | FOLDER |
  95. | shareType | 3 |
  96. And Updating last share with
  97. | expireDate | +3 days |
  98. And the OCS status code should be "100"
  99. And Getting info of last share
  100. Then the OCS status code should be "100"
  101. And the HTTP status code should be "200"
  102. And Share fields of last share match with
  103. | id | A_NUMBER |
  104. | item_type | folder |
  105. | item_source | A_NUMBER |
  106. | share_type | 3 |
  107. | file_source | A_NUMBER |
  108. | file_target | /FOLDER |
  109. | permissions | 1 |
  110. | stime | A_NUMBER |
  111. | expiration | +3 days |
  112. | token | A_TOKEN |
  113. | storage | A_NUMBER |
  114. | mail_send | 0 |
  115. | uid_owner | user0 |
  116. | storage_id | home::user0 |
  117. | file_parent | A_NUMBER |
  118. | displayname_owner | user0 |
  119. | url | AN_URL |
  120. | mimetype | httpd/unix-directory |
  121. Scenario: Creating a new public share, updating its password and getting its info
  122. Given user "user0" exists
  123. And As an "user0"
  124. When creating a share with
  125. | path | FOLDER |
  126. | shareType | 3 |
  127. And Updating last share with
  128. | password | publicpw |
  129. And the OCS status code should be "100"
  130. And Getting info of last share
  131. Then the OCS status code should be "100"
  132. And the HTTP status code should be "200"
  133. And Share fields of last share match with
  134. | id | A_NUMBER |
  135. | item_type | folder |
  136. | item_source | A_NUMBER |
  137. | share_type | 3 |
  138. | file_source | A_NUMBER |
  139. | file_target | /FOLDER |
  140. | permissions | 1 |
  141. | stime | A_NUMBER |
  142. | token | A_TOKEN |
  143. | storage | A_NUMBER |
  144. | mail_send | 0 |
  145. | uid_owner | user0 |
  146. | storage_id | home::user0 |
  147. | file_parent | A_NUMBER |
  148. | displayname_owner | user0 |
  149. | url | AN_URL |
  150. | mimetype | httpd/unix-directory |
  151. Scenario: Creating a new public share, updating its permissions and getting its info
  152. Given user "user0" exists
  153. And As an "user0"
  154. When creating a share with
  155. | path | FOLDER |
  156. | shareType | 3 |
  157. And Updating last share with
  158. | permissions | 7 |
  159. And the OCS status code should be "100"
  160. And Getting info of last share
  161. Then the OCS status code should be "100"
  162. And the HTTP status code should be "200"
  163. And Share fields of last share match with
  164. | id | A_NUMBER |
  165. | item_type | folder |
  166. | item_source | A_NUMBER |
  167. | share_type | 3 |
  168. | file_source | A_NUMBER |
  169. | file_target | /FOLDER |
  170. | permissions | 15 |
  171. | stime | A_NUMBER |
  172. | token | A_TOKEN |
  173. | storage | A_NUMBER |
  174. | mail_send | 0 |
  175. | uid_owner | user0 |
  176. | storage_id | home::user0 |
  177. | file_parent | A_NUMBER |
  178. | displayname_owner | user0 |
  179. | url | AN_URL |
  180. | mimetype | httpd/unix-directory |
  181. Scenario: Creating a new public share, updating its permissions for "hide file list"
  182. Given user "user0" exists
  183. And As an "user0"
  184. When creating a share with
  185. | path | FOLDER |
  186. | shareType | 3 |
  187. And Updating last share with
  188. | permissions | 4 |
  189. And the OCS status code should be "100"
  190. And Getting info of last share
  191. Then the OCS status code should be "100"
  192. And the HTTP status code should be "200"
  193. And Share fields of last share match with
  194. | id | A_NUMBER |
  195. | item_type | folder |
  196. | item_source | A_NUMBER |
  197. | share_type | 3 |
  198. | file_source | A_NUMBER |
  199. | file_target | /FOLDER |
  200. | permissions | 4 |
  201. | stime | A_NUMBER |
  202. | token | A_TOKEN |
  203. | storage | A_NUMBER |
  204. | mail_send | 0 |
  205. | uid_owner | user0 |
  206. | storage_id | home::user0 |
  207. | file_parent | A_NUMBER |
  208. | displayname_owner | user0 |
  209. | url | AN_URL |
  210. | mimetype | httpd/unix-directory |
  211. Scenario: Creating a new public share, updating publicUpload option and getting its info
  212. Given user "user0" exists
  213. And As an "user0"
  214. When creating a share with
  215. | path | FOLDER |
  216. | shareType | 3 |
  217. And Updating last share with
  218. | publicUpload | true |
  219. And the OCS status code should be "100"
  220. And Getting info of last share
  221. Then the OCS status code should be "100"
  222. And the HTTP status code should be "200"
  223. And Share fields of last share match with
  224. | id | A_NUMBER |
  225. | item_type | folder |
  226. | item_source | A_NUMBER |
  227. | share_type | 3 |
  228. | file_source | A_NUMBER |
  229. | file_target | /FOLDER |
  230. | permissions | 15 |
  231. | stime | A_NUMBER |
  232. | token | A_TOKEN |
  233. | storage | A_NUMBER |
  234. | mail_send | 0 |
  235. | uid_owner | user0 |
  236. | storage_id | home::user0 |
  237. | file_parent | A_NUMBER |
  238. | displayname_owner | user0 |
  239. | url | AN_URL |
  240. | mimetype | httpd/unix-directory |
  241. Scenario: getting all shares of a user using that user
  242. Given user "user0" exists
  243. And user "user1" exists
  244. And file "textfile0.txt" of user "user0" is shared with user "user1"
  245. And As an "user0"
  246. When sending "GET" to "/apps/files_sharing/api/v1/shares"
  247. Then the OCS status code should be "100"
  248. And the HTTP status code should be "200"
  249. And File "textfile0.txt" should be included in the response
  250. Scenario: getting all shares of a user using another user
  251. Given user "user0" exists
  252. And user "user1" exists
  253. And file "textfile0.txt" of user "user0" is shared with user "user1"
  254. And As an "admin"
  255. When sending "GET" to "/apps/files_sharing/api/v1/shares"
  256. Then the OCS status code should be "100"
  257. And the HTTP status code should be "200"
  258. And File "textfile0.txt" should not be included in the response
  259. Scenario: getting all shares of a file
  260. Given user "user0" exists
  261. And user "user1" exists
  262. And user "user2" exists
  263. And user "user3" exists
  264. And file "textfile0.txt" of user "user0" is shared with user "user1"
  265. And file "textfile0.txt" of user "user0" is shared with user "user2"
  266. And As an "user0"
  267. When sending "GET" to "/apps/files_sharing/api/v1/shares?path=textfile0.txt"
  268. Then the OCS status code should be "100"
  269. And the HTTP status code should be "200"
  270. And User "user1" should be included in the response
  271. And User "user2" should be included in the response
  272. And User "user3" should not be included in the response
  273. Scenario: getting all shares of a file with reshares
  274. Given user "user0" exists
  275. And user "user1" exists
  276. And user "user2" exists
  277. And user "user3" exists
  278. And file "textfile0.txt" of user "user0" is shared with user "user1"
  279. And file "textfile0 (2).txt" of user "user1" is shared with user "user2"
  280. And As an "user0"
  281. When sending "GET" to "/apps/files_sharing/api/v1/shares?reshares=true&path=textfile0.txt"
  282. Then the OCS status code should be "100"
  283. And the HTTP status code should be "200"
  284. And User "user1" should be included in the response
  285. And User "user2" should be included in the response
  286. And User "user3" should not be included in the response
  287. Scenario: Reshared files can be still accessed if a user in the middle removes it.
  288. Given user "user0" exists
  289. And user "user1" exists
  290. And user "user2" exists
  291. And user "user3" exists
  292. And file "textfile0.txt" of user "user0" is shared with user "user1"
  293. And file "textfile0 (2).txt" of user "user1" is shared with user "user2"
  294. And file "textfile0 (2).txt" of user "user2" is shared with user "user3"
  295. And As an "user1"
  296. When User "user1" deletes file "/textfile0 (2).txt"
  297. And As an "user3"
  298. And Downloading file "/textfile0 (2).txt" with range "bytes=1-8"
  299. Then Downloaded content should be "extcloud"
  300. Scenario: getting share info of a share
  301. Given user "user0" exists
  302. And user "user1" exists
  303. And file "textfile0.txt" of user "user0" is shared with user "user1"
  304. And As an "user0"
  305. When Getting info of last share
  306. Then the OCS status code should be "100"
  307. And the HTTP status code should be "200"
  308. And Share fields of last share match with
  309. | id | A_NUMBER |
  310. | item_type | file |
  311. | item_source | A_NUMBER |
  312. | share_type | 0 |
  313. | share_with | user1 |
  314. | file_source | A_NUMBER |
  315. | file_target | /textfile0.txt |
  316. | path | /textfile0.txt |
  317. | permissions | 19 |
  318. | stime | A_NUMBER |
  319. | storage | A_NUMBER |
  320. | mail_send | 0 |
  321. | uid_owner | user0 |
  322. | storage_id | home::user0 |
  323. | file_parent | A_NUMBER |
  324. | share_with_displayname | user1 |
  325. | displayname_owner | user0 |
  326. | mimetype | text/plain |
  327. Scenario: keep group permissions in sync
  328. Given As an "admin"
  329. Given user "user0" exists
  330. And user "user1" exists
  331. And group "group1" exists
  332. And user "user1" belongs to group "group1"
  333. And file "textfile0.txt" of user "user0" is shared with group "group1"
  334. And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  335. And As an "user0"
  336. When Updating last share with
  337. | permissions | 1 |
  338. And Getting info of last share
  339. Then the OCS status code should be "100"
  340. And the HTTP status code should be "200"
  341. And Share fields of last share match with
  342. | id | A_NUMBER |
  343. | item_type | file |
  344. | item_source | A_NUMBER |
  345. | share_type | 1 |
  346. | file_source | A_NUMBER |
  347. | file_target | /textfile0.txt |
  348. | permissions | 1 |
  349. | stime | A_NUMBER |
  350. | storage | A_NUMBER |
  351. | mail_send | 0 |
  352. | uid_owner | user0 |
  353. | storage_id | home::user0 |
  354. | file_parent | A_NUMBER |
  355. | displayname_owner | user0 |
  356. | mimetype | text/plain |
  357. Scenario: Sharee can see the share
  358. Given user "user0" exists
  359. And user "user1" exists
  360. And file "textfile0.txt" of user "user0" is shared with user "user1"
  361. And As an "user1"
  362. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  363. Then the OCS status code should be "100"
  364. And the HTTP status code should be "200"
  365. And last share_id is included in the answer
  366. Scenario: Sharee can see the filtered share
  367. Given user "user0" exists
  368. And user "user1" exists
  369. And file "textfile0.txt" of user "user0" is shared with user "user1"
  370. And file "textfile1.txt" of user "user0" is shared with user "user1"
  371. And As an "user1"
  372. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true&path=textfile1 (2).txt"
  373. Then the OCS status code should be "100"
  374. And the HTTP status code should be "200"
  375. And last share_id is included in the answer
  376. Scenario: Sharee can't see the share that is filtered out
  377. Given user "user0" exists
  378. And user "user1" exists
  379. And file "textfile0.txt" of user "user0" is shared with user "user1"
  380. And file "textfile1.txt" of user "user0" is shared with user "user1"
  381. And As an "user1"
  382. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true&path=textfile0 (2).txt"
  383. Then the OCS status code should be "100"
  384. And the HTTP status code should be "200"
  385. And last share_id is not included in the answer
  386. Scenario: Sharee can see the group share
  387. Given As an "admin"
  388. And user "user0" exists
  389. And user "user1" exists
  390. And group "group0" exists
  391. And user "user1" belongs to group "group0"
  392. And file "textfile0.txt" of user "user0" is shared with group "group0"
  393. And As an "user1"
  394. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  395. Then the OCS status code should be "100"
  396. And the HTTP status code should be "200"
  397. And last share_id is included in the answer
  398. Scenario: User is not allowed to reshare file
  399. As an "admin"
  400. Given user "user0" exists
  401. And user "user1" exists
  402. And user "user2" exists
  403. And As an "user0"
  404. And creating a share with
  405. | path | /textfile0.txt |
  406. | shareType | 0 |
  407. | shareWith | user1 |
  408. | permissions | 8 |
  409. And As an "user1"
  410. When creating a share with
  411. | path | /textfile0 (2).txt |
  412. | shareType | 0 |
  413. | shareWith | user2 |
  414. | permissions | 31 |
  415. Then the OCS status code should be "404"
  416. And the HTTP status code should be "200"
  417. Scenario: User is not allowed to reshare file with more permissions
  418. As an "admin"
  419. Given user "user0" exists
  420. And user "user1" exists
  421. And user "user2" exists
  422. And As an "user0"
  423. And creating a share with
  424. | path | /textfile0.txt |
  425. | shareType | 0 |
  426. | shareWith | user1 |
  427. | permissions | 16 |
  428. And As an "user1"
  429. When creating a share with
  430. | path | /textfile0 (2).txt |
  431. | shareType | 0 |
  432. | shareWith | user2 |
  433. | permissions | 31 |
  434. Then the OCS status code should be "404"
  435. And the HTTP status code should be "200"
  436. Scenario: Get a share with a user which didn't received the share
  437. Given user "user0" exists
  438. And user "user1" exists
  439. And user "user2" exists
  440. And file "textfile0.txt" of user "user0" is shared with user "user1"
  441. And As an "user2"
  442. When Getting info of last share
  443. Then the OCS status code should be "404"
  444. And the HTTP status code should be "200"
  445. Scenario: Share of folder and sub-folder to same user - core#20645
  446. Given As an "admin"
  447. And user "user0" exists
  448. And user "user1" exists
  449. And group "group0" exists
  450. And user "user1" belongs to group "group0"
  451. And file "/PARENT" of user "user0" is shared with user "user1"
  452. When file "/PARENT/CHILD" of user "user0" is shared with group "group0"
  453. Then user "user1" should see following elements
  454. | /FOLDER/ |
  455. | /PARENT/ |
  456. | /CHILD/ |
  457. | /PARENT/parent.txt |
  458. | /CHILD/child.txt |
  459. And the HTTP status code should be "200"
  460. Scenario: Share a file by multiple channels
  461. Given As an "admin"
  462. And user "user0" exists
  463. And user "user1" exists
  464. And user "user2" exists
  465. And group "group0" exists
  466. And user "user1" belongs to group "group0"
  467. And user "user2" belongs to group "group0"
  468. And user "user0" created a folder "/common"
  469. And user "user0" created a folder "/common/sub"
  470. And file "common" of user "user0" is shared with group "group0"
  471. And file "textfile0.txt" of user "user1" is shared with user "user2"
  472. And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
  473. And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
  474. And As an "user2"
  475. When Downloading file "/common/sub/textfile0.txt" with range "bytes=10-18"
  476. Then Downloaded content should be "test text"
  477. And Downloaded content when downloading file "/textfile0.txt" with range "bytes=10-18" should be "test text"
  478. And user "user2" should see following elements
  479. | /common/sub/textfile0.txt |
  480. Scenario: Share a file by multiple channels
  481. Given As an "admin"
  482. And user "user0" exists
  483. And user "user1" exists
  484. And user "user2" exists
  485. And group "group0" exists
  486. And user "user1" belongs to group "group0"
  487. And user "user2" belongs to group "group0"
  488. And user "user0" created a folder "/common"
  489. And user "user0" created a folder "/common/sub"
  490. And file "common" of user "user0" is shared with group "group0"
  491. And file "textfile0.txt" of user "user1" is shared with user "user2"
  492. And User "user1" moved file "/textfile0.txt" to "/common/textfile0.txt"
  493. And User "user1" moved file "/common/textfile0.txt" to "/common/sub/textfile0.txt"
  494. And As an "user2"
  495. When Downloading file "/textfile0.txt" with range "bytes=10-18"
  496. Then Downloaded content should be "test text"
  497. And user "user2" should see following elements
  498. | /common/sub/textfile0.txt |
  499. Scenario: Delete all group shares
  500. Given As an "admin"
  501. And user "user0" exists
  502. And user "user1" exists
  503. And group "group1" exists
  504. And user "user1" belongs to group "group1"
  505. And file "textfile0.txt" of user "user0" is shared with group "group1"
  506. And User "user1" moved file "/textfile0.txt" to "/FOLDER/textfile0.txt"
  507. And As an "user0"
  508. And Deleting last share
  509. And As an "user1"
  510. When sending "GET" to "/apps/files_sharing/api/v1/shares?shared_with_me=true"
  511. Then the OCS status code should be "100"
  512. And the HTTP status code should be "200"
  513. And last share_id is not included in the answer
  514. Scenario: delete a share
  515. Given user "user0" exists
  516. And user "user1" exists
  517. And file "textfile0.txt" of user "user0" is shared with user "user1"
  518. And As an "user0"
  519. When Deleting last share
  520. Then the OCS status code should be "100"
  521. And the HTTP status code should be "200"
  522. Scenario: Keep usergroup shares (#22143)
  523. Given As an "admin"
  524. And user "user0" exists
  525. And user "user1" exists
  526. And user "user2" exists
  527. And group "group" exists
  528. And user "user1" belongs to group "group"
  529. And user "user2" belongs to group "group"
  530. And user "user0" created a folder "/TMP"
  531. And file "TMP" of user "user0" is shared with group "group"
  532. And user "user1" created a folder "/myFOLDER"
  533. And User "user1" moves file "/TMP" to "/myFOLDER/myTMP"
  534. And user "user2" does not exist
  535. And user "user1" should see following elements
  536. | /myFOLDER/myTMP/ |
  537. Scenario: Check quota of owners parent directory of a shared file
  538. Given using dav path "remote.php/webdav"
  539. And As an "admin"
  540. And user "user0" exists
  541. And user "user1" exists
  542. And user "user1" has a quota of "0"
  543. And User "user0" moved file "/welcome.txt" to "/myfile.txt"
  544. And file "myfile.txt" of user "user0" is shared with user "user1"
  545. When User "user1" uploads file "data/textfile.txt" to "/myfile.txt"
  546. Then the HTTP status code should be "204"
  547. Scenario: Don't allow sharing of the root
  548. Given user "user0" exists
  549. And As an "user0"
  550. When creating a share with
  551. | path | / |
  552. | shareType | 3 |
  553. Then the OCS status code should be "403"
  554. Scenario: Allow modification of reshare
  555. Given user "user0" exists
  556. And user "user1" exists
  557. And user "user2" exists
  558. And user "user0" created a folder "/TMP"
  559. And file "TMP" of user "user0" is shared with user "user1"
  560. And file "TMP" of user "user1" is shared with user "user2"
  561. And As an "user1"
  562. When Updating last share with
  563. | permissions | 1 |
  564. Then the OCS status code should be "100"
  565. Scenario: Do not allow reshare to exceed permissions
  566. Given user "user0" exists
  567. And user "user1" exists
  568. And user "user2" exists
  569. And user "user0" created a folder "/TMP"
  570. And As an "user0"
  571. And creating a share with
  572. | path | /TMP |
  573. | shareType | 0 |
  574. | shareWith | user1 |
  575. | permissions | 21 |
  576. And As an "user1"
  577. And creating a share with
  578. | path | /TMP |
  579. | shareType | 0 |
  580. | shareWith | user2 |
  581. | permissions | 21 |
  582. When Updating last share with
  583. | permissions | 31 |
  584. Then the OCS status code should be "404"
  585. Scenario: Only allow 1 link share per file/folder
  586. Given user "user0" exists
  587. And As an "user0"
  588. And creating a share with
  589. | path | welcome.txt |
  590. | shareType | 3 |
  591. When save last share id
  592. And creating a share with
  593. | path | welcome.txt |
  594. | shareType | 3 |
  595. Then share ids should match
  596. Scenario: Correct webdav share-permissions for owned file
  597. Given user "user0" exists
  598. And User "user0" uploads file with content "foo" to "/tmp.txt"
  599. When as "user0" gets properties of folder "/tmp.txt" with
  600. |{http://open-collaboration-services.org/ns}share-permissions |
  601. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
  602. Scenario: Correct webdav share-permissions for received file with edit and reshare permissions
  603. Given user "user0" exists
  604. And user "user1" exists
  605. And User "user0" uploads file with content "foo" to "/tmp.txt"
  606. And file "tmp.txt" of user "user0" is shared with user "user1"
  607. When as "user1" gets properties of folder "/tmp.txt" with
  608. |{http://open-collaboration-services.org/ns}share-permissions |
  609. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "19"
  610. Scenario: Correct webdav share-permissions for received file with edit permissions but no reshare permissions
  611. Given user "user0" exists
  612. And user "user1" exists
  613. And User "user0" uploads file with content "foo" to "/tmp.txt"
  614. And file "tmp.txt" of user "user0" is shared with user "user1"
  615. And As an "user0"
  616. And Updating last share with
  617. | permissions | 3 |
  618. When as "user1" gets properties of folder "/tmp.txt" with
  619. |{http://open-collaboration-services.org/ns}share-permissions |
  620. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "3"
  621. Scenario: Correct webdav share-permissions for received file with reshare permissions but no edit permissions
  622. Given user "user0" exists
  623. And user "user1" exists
  624. And User "user0" uploads file with content "foo" to "/tmp.txt"
  625. And file "tmp.txt" of user "user0" is shared with user "user1"
  626. And As an "user0"
  627. And Updating last share with
  628. | permissions | 17 |
  629. When as "user1" gets properties of folder "/tmp.txt" with
  630. |{http://open-collaboration-services.org/ns}share-permissions |
  631. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "17"
  632. Scenario: Correct webdav share-permissions for owned folder
  633. Given user "user0" exists
  634. And user "user0" created a folder "/tmp"
  635. When as "user0" gets properties of folder "/" with
  636. |{http://open-collaboration-services.org/ns}share-permissions |
  637. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
  638. Scenario: Correct webdav share-permissions for received folder with all permissions
  639. Given user "user0" exists
  640. And user "user1" exists
  641. And user "user0" created a folder "/tmp"
  642. And file "/tmp" of user "user0" is shared with user "user1"
  643. When as "user1" gets properties of folder "/tmp" with
  644. |{http://open-collaboration-services.org/ns}share-permissions |
  645. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "31"
  646. Scenario: Correct webdav share-permissions for received folder with all permissions but edit
  647. Given user "user0" exists
  648. And user "user1" exists
  649. And user "user0" created a folder "/tmp"
  650. And file "/tmp" of user "user0" is shared with user "user1"
  651. And As an "user0"
  652. And Updating last share with
  653. | permissions | 29 |
  654. When as "user1" gets properties of folder "/tmp" with
  655. |{http://open-collaboration-services.org/ns}share-permissions |
  656. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "29"
  657. Scenario: Correct webdav share-permissions for received folder with all permissions but create
  658. Given user "user0" exists
  659. And user "user1" exists
  660. And user "user0" created a folder "/tmp"
  661. And file "/tmp" of user "user0" is shared with user "user1"
  662. And As an "user0"
  663. And Updating last share with
  664. | permissions | 27 |
  665. When as "user1" gets properties of folder "/tmp" with
  666. |{http://open-collaboration-services.org/ns}share-permissions |
  667. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "27"
  668. Scenario: Correct webdav share-permissions for received folder with all permissions but delete
  669. Given user "user0" exists
  670. And user "user1" exists
  671. And user "user0" created a folder "/tmp"
  672. And file "/tmp" of user "user0" is shared with user "user1"
  673. And As an "user0"
  674. And Updating last share with
  675. | permissions | 23 |
  676. When as "user1" gets properties of folder "/tmp" with
  677. |{http://open-collaboration-services.org/ns}share-permissions |
  678. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "23"
  679. Scenario: Correct webdav share-permissions for received folder with all permissions but share
  680. Given user "user0" exists
  681. And user "user1" exists
  682. And user "user0" created a folder "/tmp"
  683. And file "/tmp" of user "user0" is shared with user "user1"
  684. And As an "user0"
  685. And Updating last share with
  686. | permissions | 15 |
  687. When as "user1" gets properties of folder "/tmp" with
  688. |{http://open-collaboration-services.org/ns}share-permissions |
  689. Then the single response should contain a property "{http://open-collaboration-services.org/ns}share-permissions" with value "15"
  690. Scenario: unique target names for incoming shares
  691. Given user "user0" exists
  692. And user "user1" exists
  693. And user "user2" exists
  694. And user "user0" created a folder "/foo"
  695. And user "user1" created a folder "/foo"
  696. When file "/foo" of user "user0" is shared with user "user2"
  697. And file "/foo" of user "user1" is shared with user "user2"
  698. Then user "user2" should see following elements
  699. | /foo/ |
  700. | /foo%20(2)/ |
  701. Scenario: Creating a new share with a disabled user
  702. Given As an "admin"
  703. And user "user0" exists
  704. And user "user1" exists
  705. And assure user "user0" is disabled
  706. And As an "user0"
  707. When sending "POST" to "/apps/files_sharing/api/v1/shares" with
  708. | path | welcome.txt |
  709. | shareWith | user1 |
  710. | shareType | 0 |
  711. Then the OCS status code should be "997"
  712. And the HTTP status code should be "401"
  713. Scenario: Deleting a group share as user
  714. Given As an "admin"
  715. And user "user0" exists
  716. And user "user1" exists
  717. And group "group1" exists
  718. And user "user1" belongs to group "group1"
  719. And As an "user0"
  720. And creating a share with
  721. | path | welcome.txt |
  722. | shareType | 1 |
  723. | shareWith | group1 |
  724. When As an "user1"
  725. And Deleting last share
  726. Then the OCS status code should be "404"
  727. And the HTTP status code should be "200"
  728. Scenario: Merging shares for recipient when shared from outside with group and member
  729. Given As an "admin"
  730. And user "user0" exists
  731. And user "user1" exists
  732. And group "group1" exists
  733. And user "user1" belongs to group "group1"
  734. And user "user0" created a folder "merge-test-outside"
  735. When folder "merge-test-outside" of user "user0" is shared with group "group1"
  736. And folder "merge-test-outside" of user "user0" is shared with user "user1"
  737. Then as "user1" the folder "merge-test-outside" exists
  738. And as "user1" the folder "merge-test-outside (2)" does not exist
  739. Scenario: Merging shares for recipient when shared from outside with group and member with different permissions
  740. Given As an "admin"
  741. And user "user0" exists
  742. And user "user1" exists
  743. And group "group1" exists
  744. And user "user1" belongs to group "group1"
  745. And user "user0" created a folder "merge-test-outside-perms"
  746. When folder "merge-test-outside-perms" of user "user0" is shared with group "group1" with permissions 1
  747. And folder "merge-test-outside-perms" of user "user0" is shared with user "user1" with permissions 31
  748. Then as "user1" gets properties of folder "merge-test-outside-perms" with
  749. |{http://owncloud.org/ns}permissions|
  750. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  751. And as "user1" the folder "merge-test-outside-perms (2)" does not exist
  752. Scenario: Merging shares for recipient when shared from outside with two groups
  753. Given As an "admin"
  754. And user "user0" exists
  755. And user "user1" exists
  756. And group "group1" exists
  757. And group "group2" exists
  758. And user "user1" belongs to group "group1"
  759. And user "user1" belongs to group "group2"
  760. And user "user0" created a folder "merge-test-outside-twogroups"
  761. When folder "merge-test-outside-twogroups" of user "user0" is shared with group "group1"
  762. And folder "merge-test-outside-twogroups" of user "user0" is shared with group "group2"
  763. Then as "user1" the folder "merge-test-outside-twogroups" exists
  764. And as "user1" the folder "merge-test-outside-twogroups (2)" does not exist
  765. Scenario: Merging shares for recipient when shared from outside with two groups with different permissions
  766. Given As an "admin"
  767. And user "user0" exists
  768. And user "user1" exists
  769. And group "group1" exists
  770. And group "group2" exists
  771. And user "user1" belongs to group "group1"
  772. And user "user1" belongs to group "group2"
  773. And user "user0" created a folder "merge-test-outside-twogroups-perms"
  774. When folder "merge-test-outside-twogroups-perms" of user "user0" is shared with group "group1" with permissions 1
  775. And folder "merge-test-outside-twogroups-perms" of user "user0" is shared with group "group2" with permissions 31
  776. Then as "user1" gets properties of folder "merge-test-outside-twogroups-perms" with
  777. |{http://owncloud.org/ns}permissions|
  778. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  779. And as "user1" the folder "merge-test-outside-twogroups-perms (2)" does not exist
  780. Scenario: Merging shares for recipient when shared from outside with two groups and member
  781. Given As an "admin"
  782. And user "user0" exists
  783. And user "user1" exists
  784. And group "group1" exists
  785. And group "group2" exists
  786. And user "user1" belongs to group "group1"
  787. And user "user1" belongs to group "group2"
  788. And user "user0" created a folder "merge-test-outside-twogroups-member-perms"
  789. When folder "merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group1" with permissions 1
  790. And folder "merge-test-outside-twogroups-member-perms" of user "user0" is shared with group "group2" with permissions 31
  791. And folder "merge-test-outside-twogroups-member-perms" of user "user0" is shared with user "user1" with permissions 1
  792. Then as "user1" gets properties of folder "merge-test-outside-twogroups-member-perms" with
  793. |{http://owncloud.org/ns}permissions|
  794. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  795. And as "user1" the folder "merge-test-outside-twogroups-member-perms (2)" does not exist
  796. Scenario: Merging shares for recipient when shared from inside with group
  797. Given As an "admin"
  798. And user "user0" exists
  799. And group "group1" exists
  800. And user "user0" belongs to group "group1"
  801. And user "user0" created a folder "merge-test-inside-group"
  802. When folder "/merge-test-inside-group" of user "user0" is shared with group "group1"
  803. Then as "user0" the folder "merge-test-inside-group" exists
  804. And as "user0" the folder "merge-test-inside-group (2)" does not exist
  805. Scenario: Merging shares for recipient when shared from inside with two groups
  806. Given As an "admin"
  807. And user "user0" exists
  808. And group "group1" exists
  809. And group "group2" exists
  810. And user "user0" belongs to group "group1"
  811. And user "user0" belongs to group "group2"
  812. And user "user0" created a folder "merge-test-inside-twogroups"
  813. When folder "merge-test-inside-twogroups" of user "user0" is shared with group "group1"
  814. And folder "merge-test-inside-twogroups" of user "user0" is shared with group "group2"
  815. Then as "user0" the folder "merge-test-inside-twogroups" exists
  816. And as "user0" the folder "merge-test-inside-twogroups (2)" does not exist
  817. And as "user0" the folder "merge-test-inside-twogroups (3)" does not exist
  818. Scenario: Merging shares for recipient when shared from inside with group with less permissions
  819. Given As an "admin"
  820. And user "user0" exists
  821. And group "group1" exists
  822. And group "group2" exists
  823. And user "user0" belongs to group "group1"
  824. And user "user0" belongs to group "group2"
  825. And user "user0" created a folder "merge-test-inside-twogroups-perms"
  826. When folder "merge-test-inside-twogroups-perms" of user "user0" is shared with group "group1"
  827. And folder "merge-test-inside-twogroups-perms" of user "user0" is shared with group "group2"
  828. Then as "user0" gets properties of folder "merge-test-inside-twogroups-perms" with
  829. |{http://owncloud.org/ns}permissions|
  830. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "RDNVCK"
  831. And as "user0" the folder "merge-test-inside-twogroups-perms (2)" does not exist
  832. And as "user0" the folder "merge-test-inside-twogroups-perms (3)" does not exist
  833. Scenario: Merging shares for recipient when shared from outside with group then user and recipient renames in between
  834. Given As an "admin"
  835. And user "user0" exists
  836. And user "user1" exists
  837. And group "group1" exists
  838. And user "user1" belongs to group "group1"
  839. And user "user0" created a folder "merge-test-outside-groups-renamebeforesecondshare"
  840. When folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
  841. And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
  842. And folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
  843. Then as "user1" gets properties of folder "merge-test-outside-groups-renamebeforesecondshare-renamed" with
  844. |{http://owncloud.org/ns}permissions|
  845. And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  846. And as "user1" the folder "merge-test-outside-groups-renamebeforesecondshare" does not exist
  847. # Scenario: Merging shares for recipient when shared from outside with user then group and recipient renames in between
  848. # Given As an "admin"
  849. # And user "user0" exists
  850. # And user "user1" exists
  851. # And group "group1" exists
  852. # And user "user1" belongs to group "group1"
  853. # And user "user0" created a folder "merge-test-outside-groups-renamebeforesecondshare"
  854. # When folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with user "user1"
  855. # And User "user1" moved folder "/merge-test-outside-groups-renamebeforesecondshare" to "/merge-test-outside-groups-renamebeforesecondshare-renamed"
  856. # And folder "merge-test-outside-groups-renamebeforesecondshare" of user "user0" is shared with group "group1"
  857. # Then as "user1" gets properties of folder "merge-test-outside-groups-renamebeforesecondshare-renamed" with
  858. # |{http://owncloud.org/ns}permissions|
  859. # And the single response should contain a property "{http://owncloud.org/ns}permissions" with value "SRDNVCK"
  860. # And as "user1" the folder "merge-test-outside-groups-renamebeforesecondshare" does not exist