provisioning-v1.feature 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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. | admin_audit |
  254. | comments |
  255. | dav |
  256. | federatedfilesharing |
  257. | federation |
  258. | files |
  259. | files_sharing |
  260. | files_trashbin |
  261. | files_versions |
  262. | provisioning_api |
  263. | systemtags |
  264. | updatenotification |
  265. Scenario: get app info
  266. Given As an "admin"
  267. When sending "GET" to "/cloud/apps/files"
  268. Then the OCS status code should be "100"
  269. And the HTTP status code should be "200"
  270. Scenario: enable an app
  271. Given As an "admin"
  272. And app "files_external" is disabled
  273. When sending "POST" to "/cloud/apps/files_external"
  274. Then the OCS status code should be "100"
  275. And the HTTP status code should be "200"
  276. And app "files_external" is enabled
  277. Scenario: disable an app
  278. Given As an "admin"
  279. And app "files_external" is enabled
  280. When sending "DELETE" to "/cloud/apps/files_external"
  281. Then the OCS status code should be "100"
  282. And the HTTP status code should be "200"
  283. And app "files_external" is disabled
  284. Scenario: disable an user
  285. Given As an "admin"
  286. And user "user1" exists
  287. When sending "PUT" to "/cloud/users/user1/disable"
  288. Then the OCS status code should be "100"
  289. And the HTTP status code should be "200"
  290. And user "user1" is disabled
  291. Scenario: enable an user
  292. Given As an "admin"
  293. And user "user1" exists
  294. And assure user "user1" is disabled
  295. When sending "PUT" to "/cloud/users/user1/enable"
  296. Then the OCS status code should be "100"
  297. And the HTTP status code should be "200"
  298. And user "user1" is enabled
  299. Scenario: Subadmin should be able to enable or disable an user in their group
  300. Given As an "admin"
  301. And user "subadmin" exists
  302. And user "user1" exists
  303. And group "new-group" exists
  304. And user "subadmin" belongs to group "new-group"
  305. And user "user1" belongs to group "new-group"
  306. And Assure user "subadmin" is subadmin of group "new-group"
  307. And As an "subadmin"
  308. When sending "PUT" to "/cloud/users/user1/disable"
  309. Then the OCS status code should be "100"
  310. Then the HTTP status code should be "200"
  311. And As an "admin"
  312. And user "user1" is disabled
  313. Scenario: Subadmin should not be able to enable or disable an user not in their group
  314. Given As an "admin"
  315. And user "subadmin" exists
  316. And user "user1" exists
  317. And group "new-group" exists
  318. And group "another-group" exists
  319. And user "subadmin" belongs to group "new-group"
  320. And user "user1" belongs to group "another-group"
  321. And Assure user "subadmin" is subadmin of group "new-group"
  322. And As an "subadmin"
  323. When sending "PUT" to "/cloud/users/user1/disable"
  324. Then the OCS status code should be "997"
  325. Then the HTTP status code should be "401"
  326. And As an "admin"
  327. And user "user1" is enabled
  328. Scenario: Subadmins should not be able to disable users that have admin permissions in their group
  329. Given As an "admin"
  330. And user "another-admin" exists
  331. And user "subadmin" exists
  332. And group "new-group" exists
  333. And user "another-admin" belongs to group "admin"
  334. And user "subadmin" belongs to group "new-group"
  335. And user "another-admin" belongs to group "new-group"
  336. And Assure user "subadmin" is subadmin of group "new-group"
  337. And As an "subadmin"
  338. When sending "PUT" to "/cloud/users/another-admin/disable"
  339. Then the OCS status code should be "997"
  340. Then the HTTP status code should be "401"
  341. And As an "admin"
  342. And user "another-admin" is enabled
  343. Scenario: Admin can disable another admin user
  344. Given As an "admin"
  345. And user "another-admin" exists
  346. And user "another-admin" belongs to group "admin"
  347. When sending "PUT" to "/cloud/users/another-admin/disable"
  348. Then the OCS status code should be "100"
  349. Then the HTTP status code should be "200"
  350. And user "another-admin" is disabled
  351. Scenario: Admin can enable another admin user
  352. Given As an "admin"
  353. And user "another-admin" exists
  354. And user "another-admin" belongs to group "admin"
  355. And assure user "another-admin" is disabled
  356. When sending "PUT" to "/cloud/users/another-admin/enable"
  357. Then the OCS status code should be "100"
  358. Then the HTTP status code should be "200"
  359. And user "another-admin" is enabled
  360. Scenario: Admin can disable subadmins in the same group
  361. Given As an "admin"
  362. And user "subadmin" exists
  363. And group "new-group" exists
  364. And user "subadmin" belongs to group "new-group"
  365. And user "admin" belongs to group "new-group"
  366. And Assure user "subadmin" is subadmin of group "new-group"
  367. When sending "PUT" to "/cloud/users/subadmin/disable"
  368. Then the OCS status code should be "100"
  369. Then the HTTP status code should be "200"
  370. And user "subadmin" is disabled
  371. Scenario: Admin can enable subadmins in the same group
  372. Given As an "admin"
  373. And user "subadmin" exists
  374. And group "new-group" exists
  375. And user "subadmin" belongs to group "new-group"
  376. And user "admin" belongs to group "new-group"
  377. And Assure user "subadmin" is subadmin of group "new-group"
  378. And assure user "another-admin" is disabled
  379. When sending "PUT" to "/cloud/users/subadmin/disable"
  380. Then the OCS status code should be "100"
  381. Then the HTTP status code should be "200"
  382. And user "subadmin" is disabled
  383. Scenario: Admin user cannot disable himself
  384. Given As an "admin"
  385. And user "another-admin" exists
  386. And user "another-admin" belongs to group "admin"
  387. And As an "another-admin"
  388. When sending "PUT" to "/cloud/users/another-admin/disable"
  389. Then the OCS status code should be "101"
  390. And the HTTP status code should be "200"
  391. And As an "admin"
  392. And user "another-admin" is enabled
  393. Scenario:Admin user cannot enable himself
  394. Given As an "admin"
  395. And user "another-admin" exists
  396. And user "another-admin" belongs to group "admin"
  397. And assure user "another-admin" is disabled
  398. And As an "another-admin"
  399. When sending "PUT" to "/cloud/users/another-admin/enable"
  400. And As an "admin"
  401. Then user "another-admin" is disabled
  402. Scenario: disable an user with a regular user
  403. Given As an "admin"
  404. And user "user1" exists
  405. And user "user2" exists
  406. And As an "user1"
  407. When sending "PUT" to "/cloud/users/user2/disable"
  408. Then the OCS status code should be "997"
  409. And the HTTP status code should be "401"
  410. And As an "admin"
  411. And user "user2" is enabled
  412. Scenario: enable an user with a regular user
  413. Given As an "admin"
  414. And user "user1" exists
  415. And user "user2" exists
  416. And assure user "user2" is disabled
  417. And As an "user1"
  418. When sending "PUT" to "/cloud/users/user2/enable"
  419. Then the OCS status code should be "997"
  420. And the HTTP status code should be "401"
  421. And As an "admin"
  422. And user "user2" is disabled
  423. Scenario: Subadmin should not be able to disable himself
  424. Given As an "admin"
  425. And user "subadmin" exists
  426. And group "new-group" exists
  427. And user "subadmin" belongs to group "new-group"
  428. And Assure user "subadmin" is subadmin of group "new-group"
  429. And As an "subadmin"
  430. When sending "PUT" to "/cloud/users/subadmin/disable"
  431. Then the OCS status code should be "101"
  432. Then the HTTP status code should be "200"
  433. And As an "admin"
  434. And user "subadmin" is enabled
  435. Scenario: Subadmin should not be able to enable himself
  436. Given As an "admin"
  437. And user "subadmin" exists
  438. And group "new-group" exists
  439. And user "subadmin" belongs to group "new-group"
  440. And Assure user "subadmin" is subadmin of group "new-group"
  441. And assure user "subadmin" is disabled
  442. And As an "subadmin"
  443. When sending "PUT" to "/cloud/users/subadmin/enabled"
  444. And As an "admin"
  445. And user "subadmin" is disabled
  446. Scenario: Making a web request with an enabled user
  447. Given As an "admin"
  448. And user "user0" exists
  449. And As an "user0"
  450. When sending "GET" to "/index.php/apps/files"
  451. Then the HTTP status code should be "200"
  452. Scenario: Making a web request with a disabled user
  453. Given As an "admin"
  454. And user "user0" exists
  455. And assure user "user0" is disabled
  456. And As an "user0"
  457. When sending "GET" to "/index.php/apps/files"
  458. Then the OCS status code should be "999"
  459. And the HTTP status code should be "200"