provisioning-v1.feature 28 KB

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