provisioning-v1.feature 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856
  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. | webhook_listeners |
  570. | weather_status |
  571. | files_external |
  572. | oauth2 |
  573. Scenario: get app info
  574. Given As an "admin"
  575. When sending "GET" to "/cloud/apps/files"
  576. Then the OCS status code should be "100"
  577. And the HTTP status code should be "200"
  578. Scenario: get app info from app that does not exist
  579. Given As an "admin"
  580. When sending "GET" to "/cloud/apps/this_app_should_never_exist"
  581. Then the OCS status code should be "998"
  582. And the HTTP status code should be "200"
  583. Scenario: enable an app
  584. Given As an "admin"
  585. And app "testing" is disabled
  586. When sending "POST" to "/cloud/apps/testing"
  587. Then the OCS status code should be "100"
  588. And the HTTP status code should be "200"
  589. And app "testing" is enabled
  590. Scenario: enable an app that does not exist
  591. Given As an "admin"
  592. When sending "POST" to "/cloud/apps/this_app_should_never_exist"
  593. Then the OCS status code should be "998"
  594. And the HTTP status code should be "200"
  595. Scenario: disable an app
  596. Given As an "admin"
  597. And app "testing" is enabled
  598. When sending "DELETE" to "/cloud/apps/testing"
  599. Then the OCS status code should be "100"
  600. And the HTTP status code should be "200"
  601. And app "testing" is disabled
  602. Scenario: disable an user
  603. Given As an "admin"
  604. And user "user1" exists
  605. When sending "PUT" to "/cloud/users/user1/disable"
  606. Then the OCS status code should be "100"
  607. And the HTTP status code should be "200"
  608. And user "user1" is disabled
  609. Scenario: enable an user
  610. Given As an "admin"
  611. And user "user1" exists
  612. And assure user "user1" is disabled
  613. When sending "PUT" to "/cloud/users/user1/enable"
  614. Then the OCS status code should be "100"
  615. And the HTTP status code should be "200"
  616. And user "user1" is enabled
  617. Scenario: Subadmin should be able to enable or disable an user in their group
  618. Given As an "admin"
  619. And user "subadmin" exists
  620. And user "user1" exists
  621. And group "new-group" exists
  622. And user "subadmin" belongs to group "new-group"
  623. And user "user1" belongs to group "new-group"
  624. And Assure user "subadmin" is subadmin of group "new-group"
  625. And As an "subadmin"
  626. When sending "PUT" to "/cloud/users/user1/disable"
  627. Then the OCS status code should be "100"
  628. Then the HTTP status code should be "200"
  629. And As an "admin"
  630. And user "user1" is disabled
  631. Scenario: Subadmin should not be able to enable or disable an user not in their group
  632. Given As an "admin"
  633. And user "subadmin" exists
  634. And user "user1" exists
  635. And group "new-group" exists
  636. And group "another-group" exists
  637. And user "subadmin" belongs to group "new-group"
  638. And user "user1" belongs to group "another-group"
  639. And Assure user "subadmin" is subadmin of group "new-group"
  640. And As an "subadmin"
  641. When sending "PUT" to "/cloud/users/user1/disable"
  642. Then the OCS status code should be "998"
  643. Then the HTTP status code should be "200"
  644. And As an "admin"
  645. And user "user1" is enabled
  646. Scenario: Subadmins should not be able to disable users that have admin permissions in their group
  647. Given As an "admin"
  648. And user "another-admin" exists
  649. And user "subadmin" exists
  650. And group "new-group" exists
  651. And user "another-admin" belongs to group "admin"
  652. And user "subadmin" belongs to group "new-group"
  653. And user "another-admin" belongs to group "new-group"
  654. And Assure user "subadmin" is subadmin of group "new-group"
  655. And As an "subadmin"
  656. When sending "PUT" to "/cloud/users/another-admin/disable"
  657. Then the OCS status code should be "998"
  658. Then the HTTP status code should be "200"
  659. And As an "admin"
  660. And user "another-admin" is enabled
  661. Scenario: Admin can disable another admin user
  662. Given As an "admin"
  663. And user "another-admin" exists
  664. And user "another-admin" belongs to group "admin"
  665. When sending "PUT" to "/cloud/users/another-admin/disable"
  666. Then the OCS status code should be "100"
  667. Then the HTTP status code should be "200"
  668. And user "another-admin" is disabled
  669. Scenario: Admin can enable another admin user
  670. Given As an "admin"
  671. And user "another-admin" exists
  672. And user "another-admin" belongs to group "admin"
  673. And assure user "another-admin" is disabled
  674. When sending "PUT" to "/cloud/users/another-admin/enable"
  675. Then the OCS status code should be "100"
  676. Then the HTTP status code should be "200"
  677. And user "another-admin" is enabled
  678. Scenario: Admin can disable subadmins in the same group
  679. Given As an "admin"
  680. And user "subadmin" exists
  681. And group "new-group" exists
  682. And user "subadmin" belongs to group "new-group"
  683. And user "admin" belongs to group "new-group"
  684. And Assure user "subadmin" is subadmin of group "new-group"
  685. When sending "PUT" to "/cloud/users/subadmin/disable"
  686. Then the OCS status code should be "100"
  687. Then the HTTP status code should be "200"
  688. And user "subadmin" is disabled
  689. Scenario: Admin can enable subadmins in the same group
  690. Given As an "admin"
  691. And user "subadmin" exists
  692. And group "new-group" exists
  693. And user "subadmin" belongs to group "new-group"
  694. And user "admin" belongs to group "new-group"
  695. And Assure user "subadmin" is subadmin of group "new-group"
  696. And assure user "another-admin" is disabled
  697. When sending "PUT" to "/cloud/users/subadmin/disable"
  698. Then the OCS status code should be "100"
  699. Then the HTTP status code should be "200"
  700. And user "subadmin" is disabled
  701. Scenario: Admin user cannot disable himself
  702. Given As an "admin"
  703. And user "another-admin" exists
  704. And user "another-admin" belongs to group "admin"
  705. And As an "another-admin"
  706. When sending "PUT" to "/cloud/users/another-admin/disable"
  707. Then the OCS status code should be "101"
  708. And the HTTP status code should be "200"
  709. And As an "admin"
  710. And user "another-admin" is enabled
  711. Scenario:Admin user cannot enable himself
  712. Given As an "admin"
  713. And user "another-admin" exists
  714. And user "another-admin" belongs to group "admin"
  715. And assure user "another-admin" is disabled
  716. And As an "another-admin"
  717. When sending "PUT" to "/cloud/users/another-admin/enable"
  718. And As an "admin"
  719. Then user "another-admin" is disabled
  720. Scenario: disable an user with a regular user
  721. Given As an "admin"
  722. And user "user1" exists
  723. And user "user2" exists
  724. And As an "user1"
  725. When sending "PUT" to "/cloud/users/user2/disable"
  726. Then the OCS status code should be "403"
  727. And the HTTP status code should be "200"
  728. And As an "admin"
  729. And user "user2" is enabled
  730. Scenario: enable an user with a regular user
  731. Given As an "admin"
  732. And user "user1" exists
  733. And user "user2" exists
  734. And assure user "user2" is disabled
  735. And As an "user1"
  736. When sending "PUT" to "/cloud/users/user2/enable"
  737. Then the OCS status code should be "403"
  738. And the HTTP status code should be "200"
  739. And As an "admin"
  740. And user "user2" is disabled
  741. Scenario: Subadmin should not be able to disable himself
  742. Given As an "admin"
  743. And user "subadmin" exists
  744. And group "new-group" exists
  745. And user "subadmin" belongs to group "new-group"
  746. And Assure user "subadmin" is subadmin of group "new-group"
  747. And As an "subadmin"
  748. When sending "PUT" to "/cloud/users/subadmin/disable"
  749. Then the OCS status code should be "101"
  750. Then the HTTP status code should be "200"
  751. And As an "admin"
  752. And user "subadmin" is enabled
  753. Scenario: Subadmin should not be able to enable himself
  754. Given As an "admin"
  755. And user "subadmin" exists
  756. And group "new-group" exists
  757. And user "subadmin" belongs to group "new-group"
  758. And Assure user "subadmin" is subadmin of group "new-group"
  759. And assure user "subadmin" is disabled
  760. And As an "subadmin"
  761. When sending "PUT" to "/cloud/users/subadmin/enabled"
  762. And As an "admin"
  763. And user "subadmin" is disabled
  764. Scenario: Making a ocs request with an enabled user
  765. Given As an "admin"
  766. And user "user0" exists
  767. And As an "user0"
  768. When sending "GET" to "/cloud/capabilities"
  769. Then the HTTP status code should be "200"
  770. And the OCS status code should be "100"
  771. Scenario: Making a web request with an enabled user
  772. Given As an "admin"
  773. And user "user0" exists
  774. And As an "user0"
  775. When sending "GET" with exact url to "/index.php/apps/files"
  776. Then the HTTP status code should be "200"
  777. Scenario: Making a ocs request with a disabled user
  778. Given As an "admin"
  779. And user "user0" exists
  780. And assure user "user0" is disabled
  781. And As an "user0"
  782. When sending "GET" to "/cloud/capabilities"
  783. Then the OCS status code should be "997"
  784. And the HTTP status code should be "401"
  785. Scenario: Making a web request with a disabled user
  786. Given As an "admin"
  787. And user "user0" exists
  788. And assure user "user0" is disabled
  789. And As an "user0"
  790. When sending "GET" with exact url to "/index.php/apps/files"
  791. And the HTTP status code should be "401"