provisioning-v1.feature 18 KB

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