provisioning-v1.feature 28 KB

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