provisioning-v1.feature 28 KB

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