You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

provisioning-v1.feature 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596
  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 "404"
  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. And user "brand-new-user" has
  32. | id | brand-new-user |
  33. | displayname | brand-new-user |
  34. | email | |
  35. | phone | |
  36. | address | |
  37. | website | |
  38. | twitter | |
  39. Scenario: Get an existing user
  40. Given As an "admin"
  41. When sending "GET" to "/cloud/users/brand-new-user"
  42. Then the OCS status code should be "100"
  43. And the HTTP status code should be "200"
  44. Scenario: Getting all users
  45. Given As an "admin"
  46. And user "brand-new-user" exists
  47. And user "admin" exists
  48. When sending "GET" to "/cloud/users"
  49. Then users returned are
  50. | brand-new-user |
  51. | admin |
  52. Scenario: Edit a user
  53. Given As an "admin"
  54. And user "brand-new-user" exists
  55. When sending "PUT" to "/cloud/users/brand-new-user" with
  56. | key | displayname |
  57. | value | Brand New User |
  58. And the OCS status code should be "100"
  59. And the HTTP status code should be "200"
  60. And sending "PUT" to "/cloud/users/brand-new-user" with
  61. | key | quota |
  62. | value | 12MB |
  63. And the OCS status code should be "100"
  64. And the HTTP status code should be "200"
  65. And sending "PUT" to "/cloud/users/brand-new-user" with
  66. | key | email |
  67. | value | brand-new-user@gmail.com |
  68. And the OCS status code should be "100"
  69. And the HTTP status code should be "200"
  70. And sending "PUT" to "/cloud/users/brand-new-user" with
  71. | key | phone |
  72. | value | 0123 456 789 |
  73. And the OCS status code should be "100"
  74. And the HTTP status code should be "200"
  75. And sending "PUT" to "/cloud/users/brand-new-user" with
  76. | key | address |
  77. | value | Foo Bar Town |
  78. And the OCS status code should be "100"
  79. And the HTTP status code should be "200"
  80. And sending "PUT" to "/cloud/users/brand-new-user" with
  81. | key | website |
  82. | value | https://nextcloud.com |
  83. And the OCS status code should be "100"
  84. And the HTTP status code should be "200"
  85. And sending "PUT" to "/cloud/users/brand-new-user" with
  86. | key | twitter |
  87. | value | Nextcloud |
  88. And the OCS status code should be "100"
  89. And the HTTP status code should be "200"
  90. Then user "brand-new-user" has
  91. | id | brand-new-user |
  92. | displayname | Brand New User |
  93. | email | brand-new-user@gmail.com |
  94. | phone | 0123 456 789 |
  95. | address | Foo Bar Town |
  96. | website | https://nextcloud.com |
  97. | twitter | Nextcloud |
  98. Scenario: Create a group
  99. Given As an "admin"
  100. And group "new-group" does not exist
  101. When sending "POST" to "/cloud/groups" with
  102. | groupid | new-group |
  103. | password | 123456 |
  104. Then the OCS status code should be "100"
  105. And the HTTP status code should be "200"
  106. And group "new-group" exists
  107. Scenario: Create a group with special characters
  108. Given As an "admin"
  109. And group "España" does not exist
  110. When sending "POST" to "/cloud/groups" with
  111. | groupid | España |
  112. | password | 123456 |
  113. Then the OCS status code should be "100"
  114. And the HTTP status code should be "200"
  115. And group "España" exists
  116. Scenario: adding user to a group without sending the group
  117. Given As an "admin"
  118. And user "brand-new-user" exists
  119. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  120. | groupid | |
  121. Then the OCS status code should be "101"
  122. And the HTTP status code should be "200"
  123. Scenario: adding user to a group which doesn't exist
  124. Given As an "admin"
  125. And user "brand-new-user" exists
  126. And group "not-group" does not exist
  127. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  128. | groupid | not-group |
  129. Then the OCS status code should be "102"
  130. And the HTTP status code should be "200"
  131. Scenario: adding user to a group without privileges
  132. Given As an "brand-new-user"
  133. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  134. | groupid | new-group |
  135. Then the OCS status code should be "997"
  136. And the HTTP status code should be "401"
  137. Scenario: adding user to a group
  138. Given As an "admin"
  139. And user "brand-new-user" exists
  140. And group "new-group" exists
  141. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  142. | groupid | new-group |
  143. Then the OCS status code should be "100"
  144. And the HTTP status code should be "200"
  145. Scenario: getting groups of an user
  146. Given As an "admin"
  147. And user "brand-new-user" exists
  148. And group "new-group" exists
  149. When sending "GET" to "/cloud/users/brand-new-user/groups"
  150. Then groups returned are
  151. | new-group |
  152. And the OCS status code should be "100"
  153. Scenario: adding a user which doesn't exist to a group
  154. Given As an "admin"
  155. And user "not-user" does not exist
  156. And group "new-group" exists
  157. When sending "POST" to "/cloud/users/not-user/groups" with
  158. | groupid | new-group |
  159. Then the OCS status code should be "103"
  160. And the HTTP status code should be "200"
  161. Scenario: getting a group
  162. Given As an "admin"
  163. And group "new-group" exists
  164. When sending "GET" to "/cloud/groups/new-group"
  165. Then the OCS status code should be "100"
  166. And the HTTP status code should be "200"
  167. Scenario: Getting all groups
  168. Given As an "admin"
  169. And group "new-group" exists
  170. And group "admin" exists
  171. When sending "GET" to "/cloud/groups"
  172. Then groups returned are
  173. | España |
  174. | admin |
  175. | new-group |
  176. Scenario: create a subadmin
  177. Given As an "admin"
  178. And user "brand-new-user" exists
  179. And group "new-group" exists
  180. When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
  181. | groupid | new-group |
  182. Then the OCS status code should be "100"
  183. And the HTTP status code should be "200"
  184. Scenario: get users using a subadmin
  185. Given As an "admin"
  186. And user "brand-new-user" exists
  187. And group "new-group" exists
  188. And user "brand-new-user" belongs to group "new-group"
  189. And user "brand-new-user" is subadmin of group "new-group"
  190. And As an "brand-new-user"
  191. When sending "GET" to "/cloud/users"
  192. Then users returned are
  193. | brand-new-user |
  194. And the OCS status code should be "100"
  195. And the HTTP status code should be "200"
  196. Scenario: removing a user from a group which doesn't exists
  197. Given As an "admin"
  198. And user "brand-new-user" exists
  199. And group "not-group" does not exist
  200. When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
  201. | groupid | not-group |
  202. Then the OCS status code should be "102"
  203. Scenario: removing a user from a group
  204. Given As an "admin"
  205. And user "brand-new-user" exists
  206. And group "new-group" exists
  207. And user "brand-new-user" belongs to group "new-group"
  208. When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
  209. | groupid | new-group |
  210. Then the OCS status code should be "100"
  211. And user "brand-new-user" does not belong to group "new-group"
  212. Scenario: create a subadmin using a user which not exist
  213. Given As an "admin"
  214. And user "not-user" does not exist
  215. And group "new-group" exists
  216. When sending "POST" to "/cloud/users/not-user/subadmins" with
  217. | groupid | new-group |
  218. Then the OCS status code should be "101"
  219. And the HTTP status code should be "200"
  220. Scenario: create a subadmin using a group which not exist
  221. Given As an "admin"
  222. And user "brand-new-user" exists
  223. And group "not-group" does not exist
  224. When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
  225. | groupid | not-group |
  226. Then the OCS status code should be "102"
  227. And the HTTP status code should be "200"
  228. Scenario: Getting subadmin groups
  229. Given As an "admin"
  230. And user "brand-new-user" exists
  231. And group "new-group" exists
  232. When sending "GET" to "/cloud/users/brand-new-user/subadmins"
  233. Then subadmin groups returned are
  234. | new-group |
  235. Then the OCS status code should be "100"
  236. And the HTTP status code should be "200"
  237. Scenario: Getting subadmin groups of a user which not exist
  238. Given As an "admin"
  239. And user "not-user" does not exist
  240. And group "new-group" exists
  241. When sending "GET" to "/cloud/users/not-user/subadmins"
  242. Then the OCS status code should be "404"
  243. And the HTTP status code should be "200"
  244. Scenario: Getting subadmin users of a group
  245. Given As an "admin"
  246. And user "brand-new-user" exists
  247. And group "new-group" exists
  248. When sending "GET" to "/cloud/groups/new-group/subadmins"
  249. Then subadmin users returned are
  250. | brand-new-user |
  251. And the OCS status code should be "100"
  252. And the HTTP status code should be "200"
  253. Scenario: Getting subadmin users of a group which doesn't exist
  254. Given As an "admin"
  255. And user "brand-new-user" exists
  256. And group "not-group" does not exist
  257. When sending "GET" to "/cloud/groups/not-group/subadmins"
  258. Then the OCS status code should be "101"
  259. And the HTTP status code should be "200"
  260. Scenario: Removing subadmin from a group
  261. Given As an "admin"
  262. And user "brand-new-user" exists
  263. And group "new-group" exists
  264. And user "brand-new-user" is subadmin of group "new-group"
  265. When sending "DELETE" to "/cloud/users/brand-new-user/subadmins" with
  266. | groupid | new-group |
  267. And the OCS status code should be "100"
  268. And the HTTP status code should be "200"
  269. Scenario: Delete a user
  270. Given As an "admin"
  271. And user "brand-new-user" exists
  272. When sending "DELETE" to "/cloud/users/brand-new-user"
  273. Then the OCS status code should be "100"
  274. And the HTTP status code should be "200"
  275. And user "brand-new-user" does not exist
  276. Scenario: Delete a group
  277. Given As an "admin"
  278. And group "new-group" exists
  279. When sending "DELETE" to "/cloud/groups/new-group"
  280. Then the OCS status code should be "100"
  281. And the HTTP status code should be "200"
  282. And group "new-group" does not exist
  283. Scenario: Delete a group with special characters
  284. Given As an "admin"
  285. And group "España" exists
  286. When sending "DELETE" to "/cloud/groups/España"
  287. Then the OCS status code should be "100"
  288. And the HTTP status code should be "200"
  289. And group "España" does not exist
  290. Scenario: get enabled apps
  291. Given As an "admin"
  292. When sending "GET" to "/cloud/apps?filter=enabled"
  293. Then the OCS status code should be "100"
  294. And the HTTP status code should be "200"
  295. And apps returned are
  296. | accessibility |
  297. | cloud_federation_api |
  298. | comments |
  299. | contactsinteraction |
  300. | dashboard |
  301. | dav |
  302. | federatedfilesharing |
  303. | federation |
  304. | files |
  305. | files_sharing |
  306. | files_trashbin |
  307. | files_versions |
  308. | lookup_server_connector |
  309. | provisioning_api |
  310. | settings |
  311. | sharebymail |
  312. | systemtags |
  313. | theming |
  314. | twofactor_backupcodes |
  315. | updatenotification |
  316. | user_ldap |
  317. | viewer |
  318. | workflowengine |
  319. | files_external |
  320. | oauth2 |
  321. Scenario: get app info
  322. Given As an "admin"
  323. When sending "GET" to "/cloud/apps/files"
  324. Then the OCS status code should be "100"
  325. And the HTTP status code should be "200"
  326. Scenario: get app info from app that does not exist
  327. Given As an "admin"
  328. When sending "GET" to "/cloud/apps/this_app_should_never_exist"
  329. Then the OCS status code should be "998"
  330. And the HTTP status code should be "200"
  331. Scenario: enable an app
  332. Given As an "admin"
  333. And app "testing" is disabled
  334. When sending "POST" to "/cloud/apps/testing"
  335. Then the OCS status code should be "100"
  336. And the HTTP status code should be "200"
  337. And app "testing" is enabled
  338. Scenario: enable an app that does not exist
  339. Given As an "admin"
  340. When sending "POST" to "/cloud/apps/this_app_should_never_exist"
  341. Then the OCS status code should be "998"
  342. And the HTTP status code should be "200"
  343. Scenario: disable an app
  344. Given As an "admin"
  345. And app "testing" is enabled
  346. When sending "DELETE" to "/cloud/apps/testing"
  347. Then the OCS status code should be "100"
  348. And the HTTP status code should be "200"
  349. And app "testing" is disabled
  350. Scenario: disable an user
  351. Given As an "admin"
  352. And user "user1" exists
  353. When sending "PUT" to "/cloud/users/user1/disable"
  354. Then the OCS status code should be "100"
  355. And the HTTP status code should be "200"
  356. And user "user1" is disabled
  357. Scenario: enable an user
  358. Given As an "admin"
  359. And user "user1" exists
  360. And assure user "user1" is disabled
  361. When sending "PUT" to "/cloud/users/user1/enable"
  362. Then the OCS status code should be "100"
  363. And the HTTP status code should be "200"
  364. And user "user1" is enabled
  365. Scenario: Subadmin should be able to enable or disable an user in their group
  366. Given As an "admin"
  367. And user "subadmin" exists
  368. And user "user1" exists
  369. And group "new-group" exists
  370. And user "subadmin" belongs to group "new-group"
  371. And user "user1" belongs to group "new-group"
  372. And Assure user "subadmin" is subadmin of group "new-group"
  373. And As an "subadmin"
  374. When sending "PUT" to "/cloud/users/user1/disable"
  375. Then the OCS status code should be "100"
  376. Then the HTTP status code should be "200"
  377. And As an "admin"
  378. And user "user1" is disabled
  379. Scenario: Subadmin should not be able to enable or disable an user not in their group
  380. Given As an "admin"
  381. And user "subadmin" exists
  382. And user "user1" exists
  383. And group "new-group" exists
  384. And group "another-group" exists
  385. And user "subadmin" belongs to group "new-group"
  386. And user "user1" belongs to group "another-group"
  387. And Assure user "subadmin" is subadmin of group "new-group"
  388. And As an "subadmin"
  389. When sending "PUT" to "/cloud/users/user1/disable"
  390. Then the OCS status code should be "997"
  391. Then the HTTP status code should be "401"
  392. And As an "admin"
  393. And user "user1" is enabled
  394. Scenario: Subadmins should not be able to disable users that have admin permissions in their group
  395. Given As an "admin"
  396. And user "another-admin" exists
  397. And user "subadmin" exists
  398. And group "new-group" exists
  399. And user "another-admin" belongs to group "admin"
  400. And user "subadmin" belongs to group "new-group"
  401. And user "another-admin" belongs to group "new-group"
  402. And Assure user "subadmin" is subadmin of group "new-group"
  403. And As an "subadmin"
  404. When sending "PUT" to "/cloud/users/another-admin/disable"
  405. Then the OCS status code should be "997"
  406. Then the HTTP status code should be "401"
  407. And As an "admin"
  408. And user "another-admin" is enabled
  409. Scenario: Admin can disable another admin user
  410. Given As an "admin"
  411. And user "another-admin" exists
  412. And user "another-admin" belongs to group "admin"
  413. When sending "PUT" to "/cloud/users/another-admin/disable"
  414. Then the OCS status code should be "100"
  415. Then the HTTP status code should be "200"
  416. And user "another-admin" is disabled
  417. Scenario: Admin can enable another admin user
  418. Given As an "admin"
  419. And user "another-admin" exists
  420. And user "another-admin" belongs to group "admin"
  421. And assure user "another-admin" is disabled
  422. When sending "PUT" to "/cloud/users/another-admin/enable"
  423. Then the OCS status code should be "100"
  424. Then the HTTP status code should be "200"
  425. And user "another-admin" is enabled
  426. Scenario: Admin can disable subadmins in the same group
  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 user "admin" belongs to group "new-group"
  432. And Assure user "subadmin" is subadmin of group "new-group"
  433. When sending "PUT" to "/cloud/users/subadmin/disable"
  434. Then the OCS status code should be "100"
  435. Then the HTTP status code should be "200"
  436. And user "subadmin" is disabled
  437. Scenario: Admin can enable subadmins in the same group
  438. Given As an "admin"
  439. And user "subadmin" exists
  440. And group "new-group" exists
  441. And user "subadmin" belongs to group "new-group"
  442. And user "admin" belongs to group "new-group"
  443. And Assure user "subadmin" is subadmin of group "new-group"
  444. And assure user "another-admin" is disabled
  445. When sending "PUT" to "/cloud/users/subadmin/disable"
  446. Then the OCS status code should be "100"
  447. Then the HTTP status code should be "200"
  448. And user "subadmin" is disabled
  449. Scenario: Admin user cannot disable himself
  450. Given As an "admin"
  451. And user "another-admin" exists
  452. And user "another-admin" belongs to group "admin"
  453. And As an "another-admin"
  454. When sending "PUT" to "/cloud/users/another-admin/disable"
  455. Then the OCS status code should be "101"
  456. And the HTTP status code should be "200"
  457. And As an "admin"
  458. And user "another-admin" is enabled
  459. Scenario:Admin user cannot enable himself
  460. Given As an "admin"
  461. And user "another-admin" exists
  462. And user "another-admin" belongs to group "admin"
  463. And assure user "another-admin" is disabled
  464. And As an "another-admin"
  465. When sending "PUT" to "/cloud/users/another-admin/enable"
  466. And As an "admin"
  467. Then user "another-admin" is disabled
  468. Scenario: disable an user with a regular user
  469. Given As an "admin"
  470. And user "user1" exists
  471. And user "user2" exists
  472. And As an "user1"
  473. When sending "PUT" to "/cloud/users/user2/disable"
  474. Then the OCS status code should be "997"
  475. And the HTTP status code should be "401"
  476. And As an "admin"
  477. And user "user2" is enabled
  478. Scenario: enable an user with a regular user
  479. Given As an "admin"
  480. And user "user1" exists
  481. And user "user2" exists
  482. And assure user "user2" is disabled
  483. And As an "user1"
  484. When sending "PUT" to "/cloud/users/user2/enable"
  485. Then the OCS status code should be "997"
  486. And the HTTP status code should be "401"
  487. And As an "admin"
  488. And user "user2" is disabled
  489. Scenario: Subadmin should not be able to disable himself
  490. Given As an "admin"
  491. And user "subadmin" exists
  492. And group "new-group" exists
  493. And user "subadmin" belongs to group "new-group"
  494. And Assure user "subadmin" is subadmin of group "new-group"
  495. And As an "subadmin"
  496. When sending "PUT" to "/cloud/users/subadmin/disable"
  497. Then the OCS status code should be "101"
  498. Then the HTTP status code should be "200"
  499. And As an "admin"
  500. And user "subadmin" is enabled
  501. Scenario: Subadmin should not be able to enable himself
  502. Given As an "admin"
  503. And user "subadmin" exists
  504. And group "new-group" exists
  505. And user "subadmin" belongs to group "new-group"
  506. And Assure user "subadmin" is subadmin of group "new-group"
  507. And assure user "subadmin" is disabled
  508. And As an "subadmin"
  509. When sending "PUT" to "/cloud/users/subadmin/enabled"
  510. And As an "admin"
  511. And user "subadmin" is disabled
  512. Scenario: Making a ocs request with an enabled user
  513. Given As an "admin"
  514. And user "user0" exists
  515. And As an "user0"
  516. When sending "GET" to "/cloud/capabilities"
  517. Then the HTTP status code should be "200"
  518. And the OCS status code should be "100"
  519. Scenario: Making a web request with an enabled user
  520. Given As an "admin"
  521. And user "user0" exists
  522. And As an "user0"
  523. When sending "GET" with exact url to "/index.php/apps/files"
  524. Then the HTTP status code should be "200"
  525. Scenario: Making a ocs request with a disabled user
  526. Given As an "admin"
  527. And user "user0" exists
  528. And assure user "user0" is disabled
  529. And As an "user0"
  530. When sending "GET" to "/cloud/capabilities"
  531. Then the OCS status code should be "997"
  532. And the HTTP status code should be "401"
  533. Scenario: Making a web request with a disabled user
  534. Given As an "admin"
  535. And user "user0" exists
  536. And assure user "user0" is disabled
  537. And As an "user0"
  538. When sending "GET" with exact url to "/index.php/apps/files"
  539. And the HTTP status code should be "403"