provisioning-v1.feature 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. Feature: provisioning
  2. Background:
  3. Given using api version "1"
  4. Scenario: Getting an not existing user
  5. Given As an "admin"
  6. When sending "GET" to "/cloud/users/test"
  7. Then the OCS status code should be "998"
  8. And the HTTP status code should be "200"
  9. Scenario: Listing all users
  10. Given As an "admin"
  11. When sending "GET" to "/cloud/users"
  12. Then the OCS status code should be "100"
  13. And the HTTP status code should be "200"
  14. Scenario: Create a user
  15. Given As an "admin"
  16. And user "brand-new-user" does not exist
  17. When sending "POST" to "/cloud/users" with
  18. | userid | brand-new-user |
  19. | password | 123456 |
  20. Then the OCS status code should be "100"
  21. And the HTTP status code should be "200"
  22. And user "brand-new-user" exists
  23. Scenario: Create an existing user
  24. Given As an "admin"
  25. And user "brand-new-user" exists
  26. When sending "POST" to "/cloud/users" with
  27. | userid | brand-new-user |
  28. | password | 123456 |
  29. Then the OCS status code should be "102"
  30. And the HTTP status code should be "200"
  31. Scenario: Get an existing user
  32. Given As an "admin"
  33. When sending "GET" to "/cloud/users/brand-new-user"
  34. Then the OCS status code should be "100"
  35. And the HTTP status code should be "200"
  36. Scenario: Getting all users
  37. Given As an "admin"
  38. And user "brand-new-user" exists
  39. And user "admin" exists
  40. When sending "GET" to "/cloud/users"
  41. Then users returned are
  42. | brand-new-user |
  43. | admin |
  44. Scenario: Edit a user
  45. Given As an "admin"
  46. And user "brand-new-user" exists
  47. When sending "PUT" to "/cloud/users/brand-new-user" with
  48. | key | quota |
  49. | value | 12MB |
  50. | key | email |
  51. | value | brand-new-user@gmail.com |
  52. Then the OCS status code should be "100"
  53. And the HTTP status code should be "200"
  54. And user "brand-new-user" exists
  55. Scenario: Create a group
  56. Given As an "admin"
  57. And group "new-group" does not exist
  58. When sending "POST" to "/cloud/groups" with
  59. | groupid | new-group |
  60. | password | 123456 |
  61. Then the OCS status code should be "100"
  62. And the HTTP status code should be "200"
  63. And group "new-group" exists
  64. Scenario: Create a group with special characters
  65. Given As an "admin"
  66. And group "España" does not exist
  67. When sending "POST" to "/cloud/groups" with
  68. | groupid | España |
  69. | password | 123456 |
  70. Then the OCS status code should be "100"
  71. And the HTTP status code should be "200"
  72. And group "España" exists
  73. Scenario: adding user to a group without sending the group
  74. Given As an "admin"
  75. And user "brand-new-user" exists
  76. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  77. | groupid | |
  78. Then the OCS status code should be "101"
  79. And the HTTP status code should be "200"
  80. Scenario: adding user to a group which doesn't exist
  81. Given As an "admin"
  82. And user "brand-new-user" exists
  83. And group "not-group" does not exist
  84. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  85. | groupid | not-group |
  86. Then the OCS status code should be "102"
  87. And the HTTP status code should be "200"
  88. Scenario: adding user to a group without privileges
  89. Given As an "brand-new-user"
  90. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  91. | groupid | new-group |
  92. Then the OCS status code should be "997"
  93. And the HTTP status code should be "401"
  94. Scenario: adding user to a group
  95. Given As an "admin"
  96. And user "brand-new-user" exists
  97. And group "new-group" exists
  98. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  99. | groupid | new-group |
  100. Then the OCS status code should be "100"
  101. And the HTTP status code should be "200"
  102. Scenario: getting groups of an user
  103. Given As an "admin"
  104. And user "brand-new-user" exists
  105. And group "new-group" exists
  106. When sending "GET" to "/cloud/users/brand-new-user/groups"
  107. Then groups returned are
  108. | new-group |
  109. And the OCS status code should be "100"
  110. Scenario: adding a user which doesn't exist to a group
  111. Given As an "admin"
  112. And user "not-user" does not exist
  113. And group "new-group" exists
  114. When sending "POST" to "/cloud/users/not-user/groups" with
  115. | groupid | new-group |
  116. Then the OCS status code should be "103"
  117. And the HTTP status code should be "200"
  118. Scenario: getting a group
  119. Given As an "admin"
  120. And group "new-group" exists
  121. When sending "GET" to "/cloud/groups/new-group"
  122. Then the OCS status code should be "100"
  123. And the HTTP status code should be "200"
  124. Scenario: Getting all groups
  125. Given As an "admin"
  126. And group "new-group" exists
  127. And group "admin" exists
  128. When sending "GET" to "/cloud/groups"
  129. Then groups returned are
  130. | España |
  131. | admin |
  132. | new-group |
  133. Scenario: create a subadmin
  134. Given As an "admin"
  135. And user "brand-new-user" exists
  136. And group "new-group" exists
  137. When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
  138. | groupid | new-group |
  139. Then the OCS status code should be "100"
  140. And the HTTP status code should be "200"
  141. Scenario: get users using a subadmin
  142. Given As an "admin"
  143. And user "brand-new-user" exists
  144. And group "new-group" exists
  145. And user "brand-new-user" belongs to group "new-group"
  146. And user "brand-new-user" is subadmin of group "new-group"
  147. And As an "brand-new-user"
  148. When sending "GET" to "/cloud/users"
  149. Then users returned are
  150. | brand-new-user |
  151. And the OCS status code should be "100"
  152. And the HTTP status code should be "200"
  153. Scenario: removing a user from a group which doesn't exists
  154. Given As an "admin"
  155. And user "brand-new-user" exists
  156. And group "not-group" does not exist
  157. When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
  158. | groupid | not-group |
  159. Then the OCS status code should be "102"
  160. Scenario: removing a user from a group
  161. Given As an "admin"
  162. And user "brand-new-user" exists
  163. And group "new-group" exists
  164. And user "brand-new-user" belongs to group "new-group"
  165. When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
  166. | groupid | new-group |
  167. Then the OCS status code should be "100"
  168. And user "brand-new-user" does not belong to group "new-group"
  169. Scenario: create a subadmin using a user which not exist
  170. Given As an "admin"
  171. And user "not-user" does not exist
  172. And group "new-group" exists
  173. When sending "POST" to "/cloud/users/not-user/subadmins" with
  174. | groupid | new-group |
  175. Then the OCS status code should be "101"
  176. And the HTTP status code should be "200"
  177. Scenario: create a subadmin using a group which not exist
  178. Given As an "admin"
  179. And user "brand-new-user" exists
  180. And group "not-group" does not exist
  181. When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
  182. | groupid | not-group |
  183. Then the OCS status code should be "102"
  184. And the HTTP status code should be "200"
  185. Scenario: Getting subadmin groups
  186. Given As an "admin"
  187. And user "brand-new-user" exists
  188. And group "new-group" exists
  189. When sending "GET" to "/cloud/users/brand-new-user/subadmins"
  190. Then subadmin groups returned are
  191. | new-group |
  192. Then the OCS status code should be "100"
  193. And the HTTP status code should be "200"
  194. Scenario: Getting subadmin groups of a user which not exist
  195. Given As an "admin"
  196. And user "not-user" does not exist
  197. And group "new-group" exists
  198. When sending "GET" to "/cloud/users/not-user/subadmins"
  199. Then the OCS status code should be "101"
  200. And the HTTP status code should be "200"
  201. Scenario: Getting subadmin users of a group
  202. Given As an "admin"
  203. And user "brand-new-user" exists
  204. And group "new-group" exists
  205. When sending "GET" to "/cloud/groups/new-group/subadmins"
  206. Then subadmin users returned are
  207. | brand-new-user |
  208. And the OCS status code should be "100"
  209. And the HTTP status code should be "200"
  210. Scenario: Getting subadmin users of a group which doesn't exist
  211. Given As an "admin"
  212. And user "brand-new-user" exists
  213. And group "not-group" does not exist
  214. When sending "GET" to "/cloud/groups/not-group/subadmins"
  215. Then the OCS status code should be "101"
  216. And the HTTP status code should be "200"
  217. Scenario: Removing subadmin from a group
  218. Given As an "admin"
  219. And user "brand-new-user" exists
  220. And group "new-group" exists
  221. And user "brand-new-user" is subadmin of group "new-group"
  222. When sending "DELETE" to "/cloud/users/brand-new-user/subadmins" with
  223. | groupid | new-group |
  224. And the OCS status code should be "100"
  225. And the HTTP status code should be "200"
  226. Scenario: Delete a user
  227. Given As an "admin"
  228. And user "brand-new-user" exists
  229. When sending "DELETE" to "/cloud/users/brand-new-user"
  230. Then the OCS status code should be "100"
  231. And the HTTP status code should be "200"
  232. And user "brand-new-user" does not exist
  233. Scenario: Delete a group
  234. Given As an "admin"
  235. And group "new-group" exists
  236. When sending "DELETE" to "/cloud/groups/new-group"
  237. Then the OCS status code should be "100"
  238. And the HTTP status code should be "200"
  239. And group "new-group" does not exist
  240. Scenario: Delete a group with special characters
  241. Given As an "admin"
  242. And group "España" exists
  243. When sending "DELETE" to "/cloud/groups/España"
  244. Then the OCS status code should be "100"
  245. And the HTTP status code should be "200"
  246. And group "España" does not exist
  247. Scenario: get enabled apps
  248. Given As an "admin"
  249. When sending "GET" to "/cloud/apps?filter=enabled"
  250. Then the OCS status code should be "100"
  251. And the HTTP status code should be "200"
  252. And apps returned are
  253. | comments |
  254. | dav |
  255. | federatedfilesharing |
  256. | federation |
  257. | files |
  258. | files_sharing |
  259. | files_trashbin |
  260. | files_versions |
  261. | provisioning_api |
  262. | systemtags |
  263. | theming |
  264. | twofactor_backupcodes |
  265. | updatenotification |
  266. | workflowengine |
  267. | files_external |
  268. Scenario: get app info
  269. Given As an "admin"
  270. When sending "GET" to "/cloud/apps/files"
  271. Then the OCS status code should be "100"
  272. And the HTTP status code should be "200"
  273. Scenario: enable an app
  274. Given As an "admin"
  275. And app "testing" is disabled
  276. When sending "POST" to "/cloud/apps/testing"
  277. Then the OCS status code should be "100"
  278. And the HTTP status code should be "200"
  279. And app "testing" is enabled
  280. Scenario: disable an app
  281. Given As an "admin"
  282. And app "testing" is enabled
  283. When sending "DELETE" to "/cloud/apps/testing"
  284. Then the OCS status code should be "100"
  285. And the HTTP status code should be "200"
  286. And app "testing" is disabled
  287. Scenario: disable an user
  288. Given As an "admin"
  289. And user "user1" exists
  290. When sending "PUT" to "/cloud/users/user1/disable"
  291. Then the OCS status code should be "100"
  292. And the HTTP status code should be "200"
  293. And user "user1" is disabled
  294. Scenario: enable an user
  295. Given As an "admin"
  296. And user "user1" exists
  297. And assure user "user1" is disabled
  298. When sending "PUT" to "/cloud/users/user1/enable"
  299. Then the OCS status code should be "100"
  300. And the HTTP status code should be "200"
  301. And user "user1" is enabled
  302. Scenario: Subadmin should be able to enable or disable an user in their group
  303. Given As an "admin"
  304. And user "subadmin" exists
  305. And user "user1" exists
  306. And group "new-group" exists
  307. And user "subadmin" belongs to group "new-group"
  308. And user "user1" belongs to group "new-group"
  309. And Assure user "subadmin" is subadmin of group "new-group"
  310. And As an "subadmin"
  311. When sending "PUT" to "/cloud/users/user1/disable"
  312. Then the OCS status code should be "100"
  313. Then the HTTP status code should be "200"
  314. And As an "admin"
  315. And user "user1" is disabled
  316. Scenario: Subadmin should not be able to enable or disable an user not in their group
  317. Given As an "admin"
  318. And user "subadmin" exists
  319. And user "user1" exists
  320. And group "new-group" exists
  321. And group "another-group" exists
  322. And user "subadmin" belongs to group "new-group"
  323. And user "user1" belongs to group "another-group"
  324. And Assure user "subadmin" is subadmin of group "new-group"
  325. And As an "subadmin"
  326. When sending "PUT" to "/cloud/users/user1/disable"
  327. Then the OCS status code should be "997"
  328. Then the HTTP status code should be "401"
  329. And As an "admin"
  330. And user "user1" is enabled
  331. Scenario: Subadmins should not be able to disable users that have admin permissions in their group
  332. Given As an "admin"
  333. And user "another-admin" exists
  334. And user "subadmin" exists
  335. And group "new-group" exists
  336. And user "another-admin" belongs to group "admin"
  337. And user "subadmin" belongs to group "new-group"
  338. And user "another-admin" belongs to group "new-group"
  339. And Assure user "subadmin" is subadmin of group "new-group"
  340. And As an "subadmin"
  341. When sending "PUT" to "/cloud/users/another-admin/disable"
  342. Then the OCS status code should be "997"
  343. Then the HTTP status code should be "401"
  344. And As an "admin"
  345. And user "another-admin" is enabled
  346. Scenario: Admin can disable another admin user
  347. Given As an "admin"
  348. And user "another-admin" exists
  349. And user "another-admin" belongs to group "admin"
  350. When sending "PUT" to "/cloud/users/another-admin/disable"
  351. Then the OCS status code should be "100"
  352. Then the HTTP status code should be "200"
  353. And user "another-admin" is disabled
  354. Scenario: Admin can enable another admin user
  355. Given As an "admin"
  356. And user "another-admin" exists
  357. And user "another-admin" belongs to group "admin"
  358. And assure user "another-admin" is disabled
  359. When sending "PUT" to "/cloud/users/another-admin/enable"
  360. Then the OCS status code should be "100"
  361. Then the HTTP status code should be "200"
  362. And user "another-admin" is enabled
  363. Scenario: Admin can disable subadmins in the same group
  364. Given As an "admin"
  365. And user "subadmin" exists
  366. And group "new-group" exists
  367. And user "subadmin" belongs to group "new-group"
  368. And user "admin" belongs to group "new-group"
  369. And Assure user "subadmin" is subadmin of group "new-group"
  370. When sending "PUT" to "/cloud/users/subadmin/disable"
  371. Then the OCS status code should be "100"
  372. Then the HTTP status code should be "200"
  373. And user "subadmin" is disabled
  374. Scenario: Admin can enable subadmins in the same group
  375. Given As an "admin"
  376. And user "subadmin" exists
  377. And group "new-group" exists
  378. And user "subadmin" belongs to group "new-group"
  379. And user "admin" belongs to group "new-group"
  380. And Assure user "subadmin" is subadmin of group "new-group"
  381. And assure user "another-admin" is disabled
  382. When sending "PUT" to "/cloud/users/subadmin/disable"
  383. Then the OCS status code should be "100"
  384. Then the HTTP status code should be "200"
  385. And user "subadmin" is disabled
  386. Scenario: Admin user cannot disable himself
  387. Given As an "admin"
  388. And user "another-admin" exists
  389. And user "another-admin" belongs to group "admin"
  390. And As an "another-admin"
  391. When sending "PUT" to "/cloud/users/another-admin/disable"
  392. Then the OCS status code should be "101"
  393. And the HTTP status code should be "200"
  394. And As an "admin"
  395. And user "another-admin" is enabled
  396. Scenario:Admin user cannot enable himself
  397. Given As an "admin"
  398. And user "another-admin" exists
  399. And user "another-admin" belongs to group "admin"
  400. And assure user "another-admin" is disabled
  401. And As an "another-admin"
  402. When sending "PUT" to "/cloud/users/another-admin/enable"
  403. And As an "admin"
  404. Then user "another-admin" is disabled
  405. Scenario: disable an user with a regular user
  406. Given As an "admin"
  407. And user "user1" exists
  408. And user "user2" exists
  409. And As an "user1"
  410. When sending "PUT" to "/cloud/users/user2/disable"
  411. Then the OCS status code should be "997"
  412. And the HTTP status code should be "401"
  413. And As an "admin"
  414. And user "user2" is enabled
  415. Scenario: enable an user with a regular user
  416. Given As an "admin"
  417. And user "user1" exists
  418. And user "user2" exists
  419. And assure user "user2" is disabled
  420. And As an "user1"
  421. When sending "PUT" to "/cloud/users/user2/enable"
  422. Then the OCS status code should be "997"
  423. And the HTTP status code should be "401"
  424. And As an "admin"
  425. And user "user2" is disabled
  426. Scenario: Subadmin should not be able to disable himself
  427. Given As an "admin"
  428. And user "subadmin" exists
  429. And group "new-group" exists
  430. And user "subadmin" belongs to group "new-group"
  431. And Assure user "subadmin" is subadmin of group "new-group"
  432. And As an "subadmin"
  433. When sending "PUT" to "/cloud/users/subadmin/disable"
  434. Then the OCS status code should be "101"
  435. Then the HTTP status code should be "200"
  436. And As an "admin"
  437. And user "subadmin" is enabled
  438. Scenario: Subadmin should not be able to enable himself
  439. Given As an "admin"
  440. And user "subadmin" exists
  441. And group "new-group" exists
  442. And user "subadmin" belongs to group "new-group"
  443. And Assure user "subadmin" is subadmin of group "new-group"
  444. And assure user "subadmin" is disabled
  445. And As an "subadmin"
  446. When sending "PUT" to "/cloud/users/subadmin/enabled"
  447. And As an "admin"
  448. And user "subadmin" is disabled
  449. Scenario: Making a web request with an enabled user
  450. Given As an "admin"
  451. And user "user0" exists
  452. And As an "user0"
  453. When sending "GET" to "/cloud/capabilities"
  454. Then the HTTP status code should be "200"
  455. And the OCS status code should be "100"
  456. Scenario: Making a web request with a disabled user
  457. Given As an "admin"
  458. And user "user0" exists
  459. And assure user "user0" is disabled
  460. And As an "user0"
  461. When sending "GET" to "/cloud/capabilities"
  462. Then the OCS status code should be "997"
  463. And the HTTP status code should be "401"