1
0

provisioning-v1.feature 29 KB

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