provisioning-v1.feature 29 KB

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