provisioning-v1.feature 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. # SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
  2. # SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. Feature: provisioning
  5. Background:
  6. Given using api version "1"
  7. Scenario: Getting an not existing user
  8. Given As an "admin"
  9. When sending "GET" to "/cloud/users/test"
  10. Then the OCS status code should be "404"
  11. And the HTTP status code should be "200"
  12. Scenario: Listing all users
  13. Given As an "admin"
  14. When sending "GET" to "/cloud/users"
  15. Then the OCS status code should be "100"
  16. And the HTTP status code should be "200"
  17. Scenario: Create a user
  18. Given As an "admin"
  19. And user "brand-new-user" does not exist
  20. When sending "POST" to "/cloud/users" with
  21. | userid | brand-new-user |
  22. | password | 123456 |
  23. Then the OCS status code should be "100"
  24. And the HTTP status code should be "200"
  25. And user "brand-new-user" exists
  26. Scenario: Create an existing user
  27. Given As an "admin"
  28. And user "brand-new-user" exists
  29. When sending "POST" to "/cloud/users" with
  30. | userid | brand-new-user |
  31. | password | 123456 |
  32. Then the OCS status code should be "102"
  33. And the HTTP status code should be "200"
  34. And user "brand-new-user" has
  35. | id | brand-new-user |
  36. | displayname | brand-new-user |
  37. | email | |
  38. | phone | |
  39. | address | |
  40. | website | |
  41. | twitter | |
  42. Scenario: Get an existing user
  43. Given As an "admin"
  44. When sending "GET" to "/cloud/users/brand-new-user"
  45. Then the OCS status code should be "100"
  46. And the HTTP status code should be "200"
  47. Scenario: Getting all users
  48. Given As an "admin"
  49. And user "brand-new-user" exists
  50. And user "admin" exists
  51. When sending "GET" to "/cloud/users"
  52. Then users returned are
  53. | brand-new-user |
  54. | admin |
  55. Scenario: Get editable fields
  56. Given As an "admin"
  57. And user "brand-new-user" exists
  58. Then user "brand-new-user" has editable fields
  59. | displayname |
  60. | email |
  61. | additional_mail |
  62. | phone |
  63. | address |
  64. | website |
  65. | twitter |
  66. | fediverse |
  67. | organisation |
  68. | role |
  69. | headline |
  70. | biography |
  71. | profile_enabled |
  72. Given As an "brand-new-user"
  73. Then user "brand-new-user" has editable fields
  74. | displayname |
  75. | email |
  76. | additional_mail |
  77. | phone |
  78. | address |
  79. | website |
  80. | twitter |
  81. | fediverse |
  82. | organisation |
  83. | role |
  84. | headline |
  85. | biography |
  86. | profile_enabled |
  87. Then user "self" has editable fields
  88. | displayname |
  89. | email |
  90. | additional_mail |
  91. | phone |
  92. | address |
  93. | website |
  94. | twitter |
  95. | fediverse |
  96. | organisation |
  97. | role |
  98. | headline |
  99. | biography |
  100. | profile_enabled |
  101. Scenario: Edit a user
  102. Given As an "admin"
  103. And user "brand-new-user" exists
  104. When sending "PUT" to "/cloud/users/brand-new-user" with
  105. | key | displayname |
  106. | value | Brand New User |
  107. And the OCS status code should be "100"
  108. And the HTTP status code should be "200"
  109. And sending "PUT" to "/cloud/users/brand-new-user" with
  110. | key | quota |
  111. | value | 12MB |
  112. And the OCS status code should be "100"
  113. And the HTTP status code should be "200"
  114. And sending "PUT" to "/cloud/users/brand-new-user" with
  115. | key | email |
  116. | value | no-reply@nextcloud.com |
  117. And the OCS status code should be "100"
  118. And the HTTP status code should be "200"
  119. And sending "PUT" to "/cloud/users/brand-new-user" with
  120. | key | additional_mail |
  121. | value | no.reply@nextcloud.com |
  122. And the OCS status code should be "100"
  123. And the HTTP status code should be "200"
  124. And sending "PUT" to "/cloud/users/brand-new-user" with
  125. | key | additional_mail |
  126. | value | noreply@nextcloud.com |
  127. And the OCS status code should be "100"
  128. And the HTTP status code should be "200"
  129. And sending "PUT" to "/cloud/users/brand-new-user" with
  130. | key | phone |
  131. | value | +49 711 / 25 24 28-90 |
  132. And the OCS status code should be "100"
  133. And the HTTP status code should be "200"
  134. And sending "PUT" to "/cloud/users/brand-new-user" with
  135. | key | address |
  136. | value | Foo Bar Town |
  137. And the OCS status code should be "100"
  138. And the HTTP status code should be "200"
  139. And sending "PUT" to "/cloud/users/brand-new-user" with
  140. | key | website |
  141. | value | https://nextcloud.com |
  142. And the OCS status code should be "100"
  143. And the HTTP status code should be "200"
  144. And sending "PUT" to "/cloud/users/brand-new-user" with
  145. | key | twitter |
  146. | value | Nextcloud |
  147. And the OCS status code should be "100"
  148. And the HTTP status code should be "200"
  149. Then user "brand-new-user" has
  150. | id | brand-new-user |
  151. | displayname | Brand New User |
  152. | email | no-reply@nextcloud.com |
  153. | additional_mail | no.reply@nextcloud.com;noreply@nextcloud.com |
  154. | phone | +4971125242890 |
  155. | address | Foo Bar Town |
  156. | website | https://nextcloud.com |
  157. | twitter | Nextcloud |
  158. Scenario: Edit a user account properties scopes
  159. Given user "brand-new-user" exists
  160. And As an "brand-new-user"
  161. When sending "PUT" to "/cloud/users/brand-new-user" with
  162. | key | phoneScope |
  163. | value | v2-private |
  164. Then the OCS status code should be "100"
  165. And the HTTP status code should be "200"
  166. When sending "PUT" to "/cloud/users/brand-new-user" with
  167. | key | twitterScope |
  168. | value | v2-local |
  169. Then the OCS status code should be "100"
  170. And the HTTP status code should be "200"
  171. When sending "PUT" to "/cloud/users/brand-new-user" with
  172. | key | addressScope |
  173. | value | v2-federated |
  174. Then the OCS status code should be "100"
  175. And the HTTP status code should be "200"
  176. When sending "PUT" to "/cloud/users/brand-new-user" with
  177. | key | emailScope |
  178. | value | v2-published |
  179. Then the OCS status code should be "100"
  180. And the HTTP status code should be "200"
  181. When sending "PUT" to "/cloud/users/brand-new-user" with
  182. | key | websiteScope |
  183. | value | public |
  184. Then the OCS status code should be "100"
  185. And the HTTP status code should be "200"
  186. When sending "PUT" to "/cloud/users/brand-new-user" with
  187. | key | displaynameScope |
  188. | value | contacts |
  189. Then the OCS status code should be "100"
  190. And the HTTP status code should be "200"
  191. When sending "PUT" to "/cloud/users/brand-new-user" with
  192. | key | avatarScope |
  193. | value | private |
  194. Then the OCS status code should be "100"
  195. And the HTTP status code should be "200"
  196. And sending "PUT" to "/cloud/users/brand-new-user" with
  197. | key | email |
  198. | value | no-reply@nextcloud.com |
  199. And the OCS status code should be "100"
  200. And the HTTP status code should be "200"
  201. # Duplicating primary address
  202. And sending "PUT" to "/cloud/users/brand-new-user" with
  203. | key | additional_mail |
  204. | value | no-reply@nextcloud.com |
  205. And the OCS status code should be "102"
  206. And the HTTP status code should be "200"
  207. And sending "PUT" to "/cloud/users/brand-new-user" with
  208. | key | additional_mail |
  209. | value | no.reply2@nextcloud.com |
  210. And the OCS status code should be "100"
  211. And the HTTP status code should be "200"
  212. # Duplicating another additional address
  213. And sending "PUT" to "/cloud/users/brand-new-user" with
  214. | key | additional_mail |
  215. | value | no.reply2@nextcloud.com |
  216. And the OCS status code should be "102"
  217. And the HTTP status code should be "200"
  218. Then user "brand-new-user" has
  219. | id | brand-new-user |
  220. | phoneScope | v2-private |
  221. | twitterScope | v2-local |
  222. | addressScope | v2-federated |
  223. | emailScope | v2-published |
  224. | websiteScope | v2-published |
  225. | displaynameScope | v2-federated |
  226. | avatarScope | v2-local |
  227. Scenario: Edit a user account multivalue property scopes
  228. Given user "brand-new-user" exists
  229. And As an "brand-new-user"
  230. When sending "PUT" to "/cloud/users/brand-new-user" with
  231. | key | additional_mail |
  232. | value | no.reply3@nextcloud.com |
  233. And the OCS status code should be "100"
  234. And the HTTP status code should be "200"
  235. And sending "PUT" to "/cloud/users/brand-new-user" with
  236. | key | additional_mail |
  237. | value | noreply4@nextcloud.com |
  238. And the OCS status code should be "100"
  239. And the HTTP status code should be "200"
  240. When sending "PUT" to "/cloud/users/brand-new-user/additional_mailScope" with
  241. | key | no.reply3@nextcloud.com |
  242. | value | v2-federated |
  243. Then the OCS status code should be "100"
  244. And the HTTP status code should be "200"
  245. When sending "PUT" to "/cloud/users/brand-new-user/additional_mailScope" with
  246. | key | noreply4@nextcloud.com |
  247. | value | v2-published |
  248. Then the OCS status code should be "100"
  249. And the HTTP status code should be "200"
  250. Then user "brand-new-user" has
  251. | id | brand-new-user |
  252. | additional_mailScope | v2-federated;v2-published |
  253. Scenario: Edit a user account properties scopes with invalid or unsupported value
  254. Given user "brand-new-user" exists
  255. And As an "brand-new-user"
  256. When sending "PUT" to "/cloud/users/brand-new-user" with
  257. | key | phoneScope |
  258. | value | invalid |
  259. Then the OCS status code should be "102"
  260. And the HTTP status code should be "200"
  261. When sending "PUT" to "/cloud/users/brand-new-user" with
  262. | key | displaynameScope |
  263. | value | v2-private |
  264. Then the OCS status code should be "102"
  265. And the HTTP status code should be "200"
  266. When sending "PUT" to "/cloud/users/brand-new-user" with
  267. | key | emailScope |
  268. | value | v2-private |
  269. Then the OCS status code should be "102"
  270. And the HTTP status code should be "200"
  271. Scenario: Edit a user account multi-value property scopes with invalid or unsupported value
  272. Given user "brand-new-user" exists
  273. And As an "brand-new-user"
  274. When sending "PUT" to "/cloud/users/brand-new-user" with
  275. | key | additional_mail |
  276. | value | no.reply5@nextcloud.com |
  277. And the OCS status code should be "100"
  278. And the HTTP status code should be "200"
  279. When sending "PUT" to "/cloud/users/brand-new-user/additional_mailScope" with
  280. | key | no.reply5@nextcloud.com |
  281. | value | invalid |
  282. Then the OCS status code should be "102"
  283. And the HTTP status code should be "200"
  284. Scenario: Delete a user account multi-value property value
  285. Given user "brand-new-user" exists
  286. And As an "brand-new-user"
  287. When sending "PUT" to "/cloud/users/brand-new-user" with
  288. | key | additional_mail |
  289. | value | no.reply6@nextcloud.com |
  290. And the OCS status code should be "100"
  291. And the HTTP status code should be "200"
  292. And sending "PUT" to "/cloud/users/brand-new-user" with
  293. | key | additional_mail |
  294. | value | noreply7@nextcloud.com |
  295. And the OCS status code should be "100"
  296. And the HTTP status code should be "200"
  297. When sending "PUT" to "/cloud/users/brand-new-user/additional_mail" with
  298. | key | no.reply6@nextcloud.com |
  299. | value | |
  300. And the OCS status code should be "100"
  301. And the HTTP status code should be "200"
  302. Then user "brand-new-user" has
  303. | additional_mail | noreply7@nextcloud.com |
  304. Then user "brand-new-user" has not
  305. | additional_mail | no.reply6@nextcloud.com |
  306. Scenario: An admin cannot edit user account property scopes
  307. Given As an "admin"
  308. And user "brand-new-user" exists
  309. When sending "PUT" to "/cloud/users/brand-new-user" with
  310. | key | phoneScope |
  311. | value | v2-private |
  312. Then the OCS status code should be "103"
  313. And the HTTP status code should be "200"
  314. Scenario: Search by phone number
  315. Given As an "admin"
  316. And user "phone-user" exists
  317. And sending "PUT" to "/cloud/users/phone-user" with
  318. | key | phone |
  319. | value | +49 711 / 25 24 28-90 |
  320. And the OCS status code should be "100"
  321. And the HTTP status code should be "200"
  322. Then search users by phone for region "DE" with
  323. | random-string1 | 0711 / 123 456 78 |
  324. | random-string1 | 0711 / 252 428-90 |
  325. | random-string2 | 0711 / 90-824 252 |
  326. And the OCS status code should be "100"
  327. And the HTTP status code should be "200"
  328. Then phone matches returned are
  329. | random-string1 | phone-user@localhost:8080 |
  330. Scenario: Create a group
  331. Given As an "admin"
  332. And group "new-group" does not exist
  333. When sending "POST" to "/cloud/groups" with
  334. | groupid | new-group |
  335. | password | 123456 |
  336. Then the OCS status code should be "100"
  337. And the HTTP status code should be "200"
  338. And group "new-group" exists
  339. And group "new-group" has
  340. | displayname | new-group |
  341. Scenario: Create a group with custom display name
  342. Given As an "admin"
  343. And group "new-group" does not exist
  344. When sending "POST" to "/cloud/groups" with
  345. | groupid | new-group |
  346. | password | 123456 |
  347. | displayname | new-group-displayname |
  348. Then the OCS status code should be "100"
  349. And the HTTP status code should be "200"
  350. And group "new-group" exists
  351. And group "new-group" has
  352. | displayname | new-group-displayname |
  353. Scenario: Create a group with special characters
  354. Given As an "admin"
  355. And group "España" does not exist
  356. When sending "POST" to "/cloud/groups" with
  357. | groupid | España |
  358. | password | 123456 |
  359. Then the OCS status code should be "100"
  360. And the HTTP status code should be "200"
  361. And group "España" exists
  362. And group "España" has
  363. | displayname | España |
  364. Scenario: adding user to a group without sending the group
  365. Given As an "admin"
  366. And user "brand-new-user" exists
  367. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  368. | groupid | |
  369. Then the OCS status code should be "101"
  370. And the HTTP status code should be "200"
  371. Scenario: adding user to a group which doesn't exist
  372. Given As an "admin"
  373. And user "brand-new-user" exists
  374. And group "not-group" does not exist
  375. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  376. | groupid | not-group |
  377. Then the OCS status code should be "102"
  378. And the HTTP status code should be "200"
  379. Scenario: adding user to a group without privileges
  380. Given user "brand-new-user" exists
  381. And As an "brand-new-user"
  382. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  383. | groupid | new-group |
  384. Then the OCS status code should be "403"
  385. And the HTTP status code should be "200"
  386. Scenario: adding user to a group
  387. Given As an "admin"
  388. And user "brand-new-user" exists
  389. And group "new-group" exists
  390. When sending "POST" to "/cloud/users/brand-new-user/groups" with
  391. | groupid | new-group |
  392. Then the OCS status code should be "100"
  393. And the HTTP status code should be "200"
  394. Scenario: getting groups of an user
  395. Given As an "admin"
  396. And user "brand-new-user" exists
  397. And group "new-group" exists
  398. When sending "GET" to "/cloud/users/brand-new-user/groups"
  399. Then groups returned are
  400. | new-group |
  401. And the OCS status code should be "100"
  402. Scenario: adding a user which doesn't exist to a group
  403. Given As an "admin"
  404. And user "not-user" does not exist
  405. And group "new-group" exists
  406. When sending "POST" to "/cloud/users/not-user/groups" with
  407. | groupid | new-group |
  408. Then the OCS status code should be "103"
  409. And the HTTP status code should be "200"
  410. Scenario: getting a group
  411. Given As an "admin"
  412. And group "new-group" exists
  413. When sending "GET" to "/cloud/groups/new-group"
  414. Then the OCS status code should be "100"
  415. And the HTTP status code should be "200"
  416. Scenario: Getting all groups
  417. Given As an "admin"
  418. And group "new-group" exists
  419. And group "admin" exists
  420. When sending "GET" to "/cloud/groups"
  421. Then groups returned are
  422. | España |
  423. | admin |
  424. | new-group |
  425. Scenario: create a subadmin
  426. Given As an "admin"
  427. And user "brand-new-user" exists
  428. And group "new-group" exists
  429. When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
  430. | groupid | new-group |
  431. Then the OCS status code should be "100"
  432. And the HTTP status code should be "200"
  433. Scenario: get users using a subadmin
  434. Given As an "admin"
  435. And user "brand-new-user" exists
  436. And group "new-group" exists
  437. And user "brand-new-user" belongs to group "new-group"
  438. And user "brand-new-user" is subadmin of group "new-group"
  439. And As an "brand-new-user"
  440. When sending "GET" to "/cloud/users"
  441. Then users returned are
  442. | brand-new-user |
  443. And the OCS status code should be "100"
  444. And the HTTP status code should be "200"
  445. Scenario: removing a user from a group which doesn't exists
  446. Given As an "admin"
  447. And user "brand-new-user" exists
  448. And group "not-group" does not exist
  449. When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
  450. | groupid | not-group |
  451. Then the OCS status code should be "102"
  452. Scenario: removing a user from a group
  453. Given As an "admin"
  454. And user "brand-new-user" exists
  455. And group "new-group" exists
  456. And user "brand-new-user" belongs to group "new-group"
  457. When sending "DELETE" to "/cloud/users/brand-new-user/groups" with
  458. | groupid | new-group |
  459. Then the OCS status code should be "100"
  460. And user "brand-new-user" does not belong to group "new-group"
  461. Scenario: create a subadmin using a user which not exist
  462. Given As an "admin"
  463. And user "not-user" does not exist
  464. And group "new-group" exists
  465. When sending "POST" to "/cloud/users/not-user/subadmins" with
  466. | groupid | new-group |
  467. Then the OCS status code should be "101"
  468. And the HTTP status code should be "200"
  469. Scenario: create a subadmin using a group which not exist
  470. Given As an "admin"
  471. And user "brand-new-user" exists
  472. And group "not-group" does not exist
  473. When sending "POST" to "/cloud/users/brand-new-user/subadmins" with
  474. | groupid | not-group |
  475. Then the OCS status code should be "102"
  476. And the HTTP status code should be "200"
  477. Scenario: Getting subadmin groups
  478. Given As an "admin"
  479. And user "brand-new-user" exists
  480. And group "new-group" exists
  481. When sending "GET" to "/cloud/users/brand-new-user/subadmins"
  482. Then subadmin groups returned are
  483. | new-group |
  484. Then the OCS status code should be "100"
  485. And the HTTP status code should be "200"
  486. Scenario: Getting subadmin groups of a user which not exist
  487. Given As an "admin"
  488. And user "not-user" does not exist
  489. And group "new-group" exists
  490. When sending "GET" to "/cloud/users/not-user/subadmins"
  491. Then the OCS status code should be "404"
  492. And the HTTP status code should be "200"
  493. Scenario: Getting subadmin users of a group
  494. Given As an "admin"
  495. And user "brand-new-user" exists
  496. And group "new-group" exists
  497. When sending "GET" to "/cloud/groups/new-group/subadmins"
  498. Then subadmin users returned are
  499. | brand-new-user |
  500. And the OCS status code should be "100"
  501. And the HTTP status code should be "200"
  502. Scenario: Getting subadmin users of a group which doesn't exist
  503. Given As an "admin"
  504. And user "brand-new-user" exists
  505. And group "not-group" does not exist
  506. When sending "GET" to "/cloud/groups/not-group/subadmins"
  507. Then the OCS status code should be "101"
  508. And the HTTP status code should be "200"
  509. Scenario: Removing subadmin from a group
  510. Given As an "admin"
  511. And user "brand-new-user" exists
  512. And group "new-group" exists
  513. And user "brand-new-user" is subadmin of group "new-group"
  514. When sending "DELETE" to "/cloud/users/brand-new-user/subadmins" with
  515. | groupid | new-group |
  516. And the OCS status code should be "100"
  517. And the HTTP status code should be "200"
  518. Scenario: Delete a user
  519. Given As an "admin"
  520. And user "brand-new-user" exists
  521. When sending "DELETE" to "/cloud/users/brand-new-user"
  522. Then the OCS status code should be "100"
  523. And the HTTP status code should be "200"
  524. And user "brand-new-user" does not exist
  525. Scenario: Delete a group
  526. Given As an "admin"
  527. And group "new-group" exists
  528. When sending "DELETE" to "/cloud/groups/new-group"
  529. Then the OCS status code should be "100"
  530. And the HTTP status code should be "200"
  531. And group "new-group" does not exist
  532. Scenario: Delete a group with special characters
  533. Given As an "admin"
  534. And group "España" exists
  535. When sending "DELETE" to "/cloud/groups/España"
  536. Then the OCS status code should be "100"
  537. And the HTTP status code should be "200"
  538. And group "España" does not exist
  539. Scenario: get enabled apps
  540. Given As an "admin"
  541. When sending "GET" to "/cloud/apps?filter=enabled"
  542. Then the OCS status code should be "100"
  543. And the HTTP status code should be "200"
  544. And apps returned are
  545. | cloud_federation_api |
  546. | comments |
  547. | contactsinteraction |
  548. | dashboard |
  549. | dav |
  550. | federatedfilesharing |
  551. | federation |
  552. | files |
  553. | files_reminders |
  554. | files_sharing |
  555. | files_trashbin |
  556. | files_versions |
  557. | lookup_server_connector |
  558. | provisioning_api |
  559. | settings |
  560. | sharebymail |
  561. | systemtags |
  562. | theming |
  563. | twofactor_backupcodes |
  564. | updatenotification |
  565. | user_ldap |
  566. | user_status |
  567. | viewer |
  568. | workflowengine |
  569. | weather_status |
  570. | files_external |
  571. | oauth2 |
  572. Scenario: get app info
  573. Given As an "admin"
  574. When sending "GET" to "/cloud/apps/files"
  575. Then the OCS status code should be "100"
  576. And the HTTP status code should be "200"
  577. Scenario: get app info from app that does not exist
  578. Given As an "admin"
  579. When sending "GET" to "/cloud/apps/this_app_should_never_exist"
  580. Then the OCS status code should be "998"
  581. And the HTTP status code should be "200"
  582. Scenario: enable an app
  583. Given As an "admin"
  584. And app "testing" is disabled
  585. When sending "POST" to "/cloud/apps/testing"
  586. Then the OCS status code should be "100"
  587. And the HTTP status code should be "200"
  588. And app "testing" is enabled
  589. Scenario: enable an app that does not exist
  590. Given As an "admin"
  591. When sending "POST" to "/cloud/apps/this_app_should_never_exist"
  592. Then the OCS status code should be "998"
  593. And the HTTP status code should be "200"
  594. Scenario: disable an app
  595. Given As an "admin"
  596. And app "testing" is enabled
  597. When sending "DELETE" to "/cloud/apps/testing"
  598. Then the OCS status code should be "100"
  599. And the HTTP status code should be "200"
  600. And app "testing" is disabled
  601. Scenario: disable an user
  602. Given As an "admin"
  603. And user "user1" exists
  604. When sending "PUT" to "/cloud/users/user1/disable"
  605. Then the OCS status code should be "100"
  606. And the HTTP status code should be "200"
  607. And user "user1" is disabled
  608. Scenario: enable an user
  609. Given As an "admin"
  610. And user "user1" exists
  611. And assure user "user1" is disabled
  612. When sending "PUT" to "/cloud/users/user1/enable"
  613. Then the OCS status code should be "100"
  614. And the HTTP status code should be "200"
  615. And user "user1" is enabled
  616. Scenario: Subadmin should be able to enable or disable an user in their group
  617. Given As an "admin"
  618. And user "subadmin" exists
  619. And user "user1" exists
  620. And group "new-group" exists
  621. And user "subadmin" belongs to group "new-group"
  622. And user "user1" belongs to group "new-group"
  623. And Assure user "subadmin" is subadmin of group "new-group"
  624. And As an "subadmin"
  625. When sending "PUT" to "/cloud/users/user1/disable"
  626. Then the OCS status code should be "100"
  627. Then the HTTP status code should be "200"
  628. And As an "admin"
  629. And user "user1" is disabled
  630. Scenario: Subadmin should not be able to enable or disable an user not in their group
  631. Given As an "admin"
  632. And user "subadmin" exists
  633. And user "user1" exists
  634. And group "new-group" exists
  635. And group "another-group" exists
  636. And user "subadmin" belongs to group "new-group"
  637. And user "user1" belongs to group "another-group"
  638. And Assure user "subadmin" is subadmin of group "new-group"
  639. And As an "subadmin"
  640. When sending "PUT" to "/cloud/users/user1/disable"
  641. Then the OCS status code should be "998"
  642. Then the HTTP status code should be "200"
  643. And As an "admin"
  644. And user "user1" is enabled
  645. Scenario: Subadmins should not be able to disable users that have admin permissions in their group
  646. Given As an "admin"
  647. And user "another-admin" exists
  648. And user "subadmin" exists
  649. And group "new-group" exists
  650. And user "another-admin" belongs to group "admin"
  651. And user "subadmin" belongs to group "new-group"
  652. And user "another-admin" belongs to group "new-group"
  653. And Assure user "subadmin" is subadmin of group "new-group"
  654. And As an "subadmin"
  655. When sending "PUT" to "/cloud/users/another-admin/disable"
  656. Then the OCS status code should be "998"
  657. Then the HTTP status code should be "200"
  658. And As an "admin"
  659. And user "another-admin" is enabled
  660. Scenario: Admin can disable another admin user
  661. Given As an "admin"
  662. And user "another-admin" exists
  663. And user "another-admin" belongs to group "admin"
  664. When sending "PUT" to "/cloud/users/another-admin/disable"
  665. Then the OCS status code should be "100"
  666. Then the HTTP status code should be "200"
  667. And user "another-admin" is disabled
  668. Scenario: Admin can enable another admin user
  669. Given As an "admin"
  670. And user "another-admin" exists
  671. And user "another-admin" belongs to group "admin"
  672. And assure user "another-admin" is disabled
  673. When sending "PUT" to "/cloud/users/another-admin/enable"
  674. Then the OCS status code should be "100"
  675. Then the HTTP status code should be "200"
  676. And user "another-admin" is enabled
  677. Scenario: Admin can disable subadmins in the same group
  678. Given As an "admin"
  679. And user "subadmin" exists
  680. And group "new-group" exists
  681. And user "subadmin" belongs to group "new-group"
  682. And user "admin" belongs to group "new-group"
  683. And Assure user "subadmin" is subadmin of group "new-group"
  684. When sending "PUT" to "/cloud/users/subadmin/disable"
  685. Then the OCS status code should be "100"
  686. Then the HTTP status code should be "200"
  687. And user "subadmin" is disabled
  688. Scenario: Admin can enable subadmins in the same group
  689. Given As an "admin"
  690. And user "subadmin" exists
  691. And group "new-group" exists
  692. And user "subadmin" belongs to group "new-group"
  693. And user "admin" belongs to group "new-group"
  694. And Assure user "subadmin" is subadmin of group "new-group"
  695. And assure user "another-admin" is disabled
  696. When sending "PUT" to "/cloud/users/subadmin/disable"
  697. Then the OCS status code should be "100"
  698. Then the HTTP status code should be "200"
  699. And user "subadmin" is disabled
  700. Scenario: Admin user cannot disable himself
  701. Given As an "admin"
  702. And user "another-admin" exists
  703. And user "another-admin" belongs to group "admin"
  704. And As an "another-admin"
  705. When sending "PUT" to "/cloud/users/another-admin/disable"
  706. Then the OCS status code should be "101"
  707. And the HTTP status code should be "200"
  708. And As an "admin"
  709. And user "another-admin" is enabled
  710. Scenario:Admin user cannot enable himself
  711. Given As an "admin"
  712. And user "another-admin" exists
  713. And user "another-admin" belongs to group "admin"
  714. And assure user "another-admin" is disabled
  715. And As an "another-admin"
  716. When sending "PUT" to "/cloud/users/another-admin/enable"
  717. And As an "admin"
  718. Then user "another-admin" is disabled
  719. Scenario: disable an user with a regular user
  720. Given As an "admin"
  721. And user "user1" exists
  722. And user "user2" exists
  723. And As an "user1"
  724. When sending "PUT" to "/cloud/users/user2/disable"
  725. Then the OCS status code should be "403"
  726. And the HTTP status code should be "200"
  727. And As an "admin"
  728. And user "user2" is enabled
  729. Scenario: enable an user with a regular user
  730. Given As an "admin"
  731. And user "user1" exists
  732. And user "user2" exists
  733. And assure user "user2" is disabled
  734. And As an "user1"
  735. When sending "PUT" to "/cloud/users/user2/enable"
  736. Then the OCS status code should be "403"
  737. And the HTTP status code should be "200"
  738. And As an "admin"
  739. And user "user2" is disabled
  740. Scenario: Subadmin should not be able to disable himself
  741. Given As an "admin"
  742. And user "subadmin" exists
  743. And group "new-group" exists
  744. And user "subadmin" belongs to group "new-group"
  745. And Assure user "subadmin" is subadmin of group "new-group"
  746. And As an "subadmin"
  747. When sending "PUT" to "/cloud/users/subadmin/disable"
  748. Then the OCS status code should be "101"
  749. Then the HTTP status code should be "200"
  750. And As an "admin"
  751. And user "subadmin" is enabled
  752. Scenario: Subadmin should not be able to enable himself
  753. Given As an "admin"
  754. And user "subadmin" exists
  755. And group "new-group" exists
  756. And user "subadmin" belongs to group "new-group"
  757. And Assure user "subadmin" is subadmin of group "new-group"
  758. And assure user "subadmin" is disabled
  759. And As an "subadmin"
  760. When sending "PUT" to "/cloud/users/subadmin/enabled"
  761. And As an "admin"
  762. And user "subadmin" is disabled
  763. Scenario: Making a ocs request with an enabled user
  764. Given As an "admin"
  765. And user "user0" exists
  766. And As an "user0"
  767. When sending "GET" to "/cloud/capabilities"
  768. Then the HTTP status code should be "200"
  769. And the OCS status code should be "100"
  770. Scenario: Making a web request with an enabled user
  771. Given As an "admin"
  772. And user "user0" exists
  773. And As an "user0"
  774. When sending "GET" with exact url to "/index.php/apps/files"
  775. Then the HTTP status code should be "200"
  776. Scenario: Making a ocs request with a disabled user
  777. Given As an "admin"
  778. And user "user0" exists
  779. And assure user "user0" is disabled
  780. And As an "user0"
  781. When sending "GET" to "/cloud/capabilities"
  782. Then the OCS status code should be "997"
  783. And the HTTP status code should be "401"
  784. Scenario: Making a web request with a disabled user
  785. Given As an "admin"
  786. And user "user0" exists
  787. And assure user "user0" is disabled
  788. And As an "user0"
  789. When sending "GET" with exact url to "/index.php/apps/files"
  790. And the HTTP status code should be "401"