provisioning-v1.feature 27 KB

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