1
0

provisioning-v1.feature 30 KB

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