provisioning-v1.feature 17 KB

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