1
0

sharees.feature 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. # SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-FileCopyrightText: 2016 ownCloud, Inc.
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. Feature: sharees
  5. Background:
  6. Given using api version "1"
  7. And user "test" exists
  8. And user "Sharee1" exists
  9. And group "ShareeGroup" exists
  10. And user "test" belongs to group "ShareeGroup"
  11. Scenario: Search without exact match
  12. Given As an "test"
  13. When getting sharees for
  14. | search | Sharee |
  15. | itemType | file |
  16. Then the OCS status code should be "100"
  17. And the HTTP status code should be "200"
  18. And "exact users" sharees returned is empty
  19. And "users" sharees returned are
  20. | Sharee1 | 0 | Sharee1 |
  21. And "exact groups" sharees returned is empty
  22. And "groups" sharees returned are
  23. | ShareeGroup | 1 | ShareeGroup |
  24. And "exact remotes" sharees returned is empty
  25. And "remotes" sharees returned is empty
  26. Scenario: Search without exact match not-exact casing
  27. Given As an "test"
  28. When getting sharees for
  29. | search | sharee |
  30. | itemType | file |
  31. Then the OCS status code should be "100"
  32. And the HTTP status code should be "200"
  33. And "exact users" sharees returned is empty
  34. And "users" sharees returned are
  35. | Sharee1 | 0 | Sharee1 |
  36. And "exact groups" sharees returned is empty
  37. And "groups" sharees returned are
  38. | ShareeGroup | 1 | ShareeGroup |
  39. And "exact remotes" sharees returned is empty
  40. And "remotes" sharees returned is empty
  41. Scenario: Search only with group members - denied
  42. Given As an "test"
  43. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  44. When getting sharees for
  45. | search | sharee |
  46. | itemType | file |
  47. Then the OCS status code should be "100"
  48. And the HTTP status code should be "200"
  49. And "exact users" sharees returned is empty
  50. And "users" sharees returned is empty
  51. And "exact groups" sharees returned is empty
  52. And "groups" sharees returned are
  53. | ShareeGroup | 1 | ShareeGroup |
  54. And "exact remotes" sharees returned is empty
  55. And "remotes" sharees returned is empty
  56. Scenario: Search only with group members - allowed
  57. Given As an "test"
  58. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  59. And user "Sharee1" belongs to group "ShareeGroup"
  60. When getting sharees for
  61. | search | sharee |
  62. | itemType | file |
  63. Then the OCS status code should be "100"
  64. And the HTTP status code should be "200"
  65. And "exact users" sharees returned is empty
  66. And "users" sharees returned are
  67. | Sharee1 | 0 | Sharee1 |
  68. And "exact groups" sharees returned is empty
  69. And "groups" sharees returned are
  70. | ShareeGroup | 1 | ShareeGroup |
  71. And "exact remotes" sharees returned is empty
  72. And "remotes" sharees returned is empty
  73. Scenario: Search only with group members - allowed with exact match
  74. Given As an "test"
  75. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  76. And user "Sharee1" belongs to group "ShareeGroup"
  77. When getting sharees for
  78. | search | Sharee1 |
  79. | itemType | file |
  80. Then the OCS status code should be "100"
  81. And the HTTP status code should be "200"
  82. And "exact users" sharees returned are
  83. | Sharee1 | 0 | Sharee1 |
  84. And "users" sharees returned is empty
  85. And "exact groups" sharees returned is empty
  86. And "groups" sharees returned is empty
  87. And "exact remotes" sharees returned is empty
  88. And "remotes" sharees returned is empty
  89. Scenario: Search only with group members - no group as non-member
  90. Given As an "Sharee1"
  91. And parameter "shareapi_only_share_with_group_members" of app "core" is set to "yes"
  92. When getting sharees for
  93. | search | sharee |
  94. | itemType | file |
  95. Then the OCS status code should be "100"
  96. And the HTTP status code should be "200"
  97. And "exact users" sharees returned is empty
  98. And "users" sharees returned is empty
  99. And "exact groups" sharees returned is empty
  100. And "groups" sharees returned is empty
  101. And "exact remotes" sharees returned is empty
  102. And "remotes" sharees returned is empty
  103. Scenario: Search without exact match no iteration allowed
  104. Given As an "test"
  105. And parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
  106. When getting sharees for
  107. | search | Sharee |
  108. | itemType | file |
  109. Then the OCS status code should be "100"
  110. And the HTTP status code should be "200"
  111. And "exact users" sharees returned is empty
  112. And "users" sharees returned is empty
  113. And "exact groups" sharees returned is empty
  114. And "groups" sharees returned is empty
  115. And "exact remotes" sharees returned is empty
  116. And "remotes" sharees returned is empty
  117. Scenario: Search with exact match no iteration allowed
  118. Given As an "test"
  119. And parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
  120. When getting sharees for
  121. | search | Sharee1 |
  122. | itemType | file |
  123. Then the OCS status code should be "100"
  124. And the HTTP status code should be "200"
  125. And "exact users" sharees returned are
  126. | Sharee1 | 0 | Sharee1 |
  127. And "users" sharees returned is empty
  128. And "exact groups" sharees returned is empty
  129. And "groups" sharees returned is empty
  130. And "exact remotes" sharees returned is empty
  131. And "remotes" sharees returned is empty
  132. Scenario: Search with exact match group no iteration allowed
  133. Given As an "test"
  134. And parameter "shareapi_allow_share_dialog_user_enumeration" of app "core" is set to "no"
  135. When getting sharees for
  136. | search | ShareeGroup |
  137. | itemType | file |
  138. Then the OCS status code should be "100"
  139. And the HTTP status code should be "200"
  140. And "exact users" sharees returned is empty
  141. And "users" sharees returned is empty
  142. And "exact groups" sharees returned are
  143. | ShareeGroup | 1 | ShareeGroup |
  144. And "groups" sharees returned is empty
  145. And "exact remotes" sharees returned is empty
  146. And "remotes" sharees returned is empty
  147. Scenario: Search with exact match
  148. Given As an "test"
  149. When getting sharees for
  150. | search | Sharee1 |
  151. | itemType | file |
  152. Then the OCS status code should be "100"
  153. And the HTTP status code should be "200"
  154. Then "exact users" sharees returned are
  155. | Sharee1 | 0 | Sharee1 |
  156. Then "users" sharees returned is empty
  157. Then "exact groups" sharees returned is empty
  158. Then "groups" sharees returned is empty
  159. Then "exact remotes" sharees returned is empty
  160. Then "remotes" sharees returned is empty
  161. Scenario: Search with exact match not-exact casing
  162. Given As an "test"
  163. When getting sharees for
  164. | search | sharee1 |
  165. | itemType | file |
  166. Then the OCS status code should be "100"
  167. And the HTTP status code should be "200"
  168. Then "exact users" sharees returned are
  169. | Sharee1 | 0 | Sharee1 |
  170. Then "users" sharees returned is empty
  171. Then "exact groups" sharees returned is empty
  172. Then "groups" sharees returned is empty
  173. Then "exact remotes" sharees returned is empty
  174. Then "remotes" sharees returned is empty
  175. Scenario: Search with exact match not-exact casing group
  176. Given As an "test"
  177. When getting sharees for
  178. | search | shareegroup |
  179. | itemType | file |
  180. Then the OCS status code should be "100"
  181. And the HTTP status code should be "200"
  182. Then "exact users" sharees returned is empty
  183. Then "users" sharees returned is empty
  184. Then "exact groups" sharees returned are
  185. | ShareeGroup | 1 | ShareeGroup |
  186. Then "groups" sharees returned is empty
  187. Then "exact remotes" sharees returned is empty
  188. Then "remotes" sharees returned is empty
  189. Scenario: Search with "self"
  190. Given As an "Sharee1"
  191. When getting sharees for
  192. | search | Sharee1 |
  193. | itemType | file |
  194. Then the OCS status code should be "100"
  195. And the HTTP status code should be "200"
  196. Then "exact users" sharees returned are
  197. | Sharee1 | 0 | Sharee1 |
  198. Then "users" sharees returned is empty
  199. Then "exact groups" sharees returned is empty
  200. Then "groups" sharees returned is empty
  201. Then "exact remotes" sharees returned is empty
  202. Then "remotes" sharees returned is empty
  203. Scenario: Remote sharee for files
  204. Given As an "test"
  205. When getting sharees for
  206. | search | test@localhost |
  207. | itemType | file |
  208. Then the OCS status code should be "100"
  209. And the HTTP status code should be "200"
  210. Then "exact users" sharees returned is empty
  211. Then "users" sharees returned is empty
  212. Then "exact groups" sharees returned is empty
  213. Then "groups" sharees returned is empty
  214. Then "exact remotes" sharees returned are
  215. | test (localhost) | 6 | test@localhost |
  216. Then "remotes" sharees returned is empty
  217. Scenario: Remote sharee for calendars not allowed
  218. Given As an "test"
  219. When getting sharees for
  220. | search | test@localhost |
  221. | itemType | calendar |
  222. Then the OCS status code should be "100"
  223. And the HTTP status code should be "200"
  224. Then "exact users" sharees returned is empty
  225. Then "users" sharees returned is empty
  226. Then "exact groups" sharees returned is empty
  227. Then "groups" sharees returned is empty
  228. Then "exact remotes" sharees returned is empty
  229. Then "remotes" sharees returned is empty
  230. Scenario: Group sharees not returned when group sharing is disabled
  231. Given As an "test"
  232. And parameter "shareapi_allow_group_sharing" of app "core" is set to "no"
  233. When getting sharees for
  234. | search | sharee |
  235. | itemType | file |
  236. Then the OCS status code should be "100"
  237. And the HTTP status code should be "200"
  238. And "exact users" sharees returned is empty
  239. And "users" sharees returned are
  240. | Sharee1 | 0 | Sharee1 |
  241. And "exact groups" sharees returned is empty
  242. And "groups" sharees returned is empty
  243. And "exact remotes" sharees returned is empty
  244. And "remotes" sharees returned is empty