44
44
description : |
45
45
Add a member to the specified group
46
46
47
- If the group is private, the user needs to be a member of the group, or an admin.
47
+ If the group is private, the user needs to be a member of the group, or an admin or the user making the request is having the role of groupManager or groupAdmin .
48
48
tags :
49
49
- group membership
50
50
security :
92
92
description : |
93
93
Remove a member from specified group
94
94
95
- The user has to have admin role and the group allows self registration.
95
+ The user has to have admin role or the role of groupManager or groupAdmin and the group allows self registration.
96
96
tags :
97
97
- group membership
98
98
security :
@@ -365,6 +365,131 @@ paths:
365
365
$ref : " #/components/responses/NotFound"
366
366
500 :
367
367
$ref : " #/components/responses/InternalServerError"
368
+
369
+ /groups/{groupId}/subGroup :
370
+ post :
371
+ description : |
372
+ Creation of a new sub group
373
+
374
+ The user has to have admin role or have a "groupAdmin" role for that group.
375
+ tags :
376
+ - sub groups
377
+ security :
378
+ - bearer : []
379
+ parameters :
380
+ - $ref : ' #/components/parameters/groupId'
381
+ requestBody :
382
+ $ref : ' #/components/requestBodies/NewGroupBodyParam'
383
+ responses :
384
+ 200 :
385
+ $ref : " #/components/responses/GroupResponse"
386
+ 400 :
387
+ $ref : " #/components/responses/BadRequest"
388
+ 401 :
389
+ $ref : " #/components/responses/Unauthenticated"
390
+ 403 :
391
+ $ref : " #/components/responses/Forbidden"
392
+ 500 :
393
+ $ref : " #/components/responses/InternalServerError"
394
+
395
+ /groups/{groupId}/subGroup/{subGroupId} :
396
+ delete :
397
+ description : |
398
+ Creation of a new sub group
399
+
400
+ The user has to have admin role or have a "groupAdmin" role for that group.
401
+ tags :
402
+ - sub groups
403
+ security :
404
+ - bearer : []
405
+ parameters :
406
+ - $ref : ' #/components/parameters/groupId'
407
+ - $ref : ' #/components/parameters/subGroupId'
408
+ responses :
409
+ 204 :
410
+ description : The resource was deleted successfully.
411
+ 400 :
412
+ $ref : " #/components/responses/BadRequest"
413
+ 401 :
414
+ $ref : " #/components/responses/Unauthenticated"
415
+ 403 :
416
+ $ref : " #/components/responses/Forbidden"
417
+ 500 :
418
+ $ref : " #/components/responses/InternalServerError"
419
+
420
+ /groupRoles/users/{memberId} :
421
+ get :
422
+ description : |
423
+ Returns the groups and roles of the user identified by memberId.
424
+
425
+ The user has to have admin role.
426
+ tags :
427
+ - group roles
428
+ security :
429
+ - bearer : []
430
+ parameters :
431
+ - $ref : ' #/components/parameters/memberId'
432
+ - $ref : ' #/components/parameters/page'
433
+ - $ref : ' #/components/parameters/perPage'
434
+ responses :
435
+ 200 :
436
+ $ref : ' #/components/responses/GroupMemberRoleResponse'
437
+ 400 :
438
+ $ref : " #/components/responses/BadRequest"
439
+ 401 :
440
+ $ref : " #/components/responses/Unauthenticated"
441
+ 403 :
442
+ $ref : " #/components/responses/Forbidden"
443
+ 500 :
444
+ $ref : " #/components/responses/InternalServerError"
445
+ post :
446
+ description : |
447
+ Creation of new group role for a user
448
+
449
+ The user has to have admin role.
450
+ tags :
451
+ - group roles
452
+ security :
453
+ - bearer : []
454
+ parameters :
455
+ - $ref : ' #/components/parameters/memberId'
456
+ requestBody :
457
+ $ref : ' #/components/requestBodies/GroupRoleBodyParam'
458
+ responses :
459
+ 201 :
460
+ description : CREATED
461
+ 400 :
462
+ $ref : " #/components/responses/BadRequest"
463
+ 401 :
464
+ $ref : " #/components/responses/Unauthenticated"
465
+ 403 :
466
+ $ref : " #/components/responses/Forbidden"
467
+ 500 :
468
+ $ref : " #/components/responses/InternalServerError"
469
+ delete :
470
+ description : |
471
+ Delete a group role
472
+
473
+ The user has to have admin role.
474
+ tags :
475
+ - group roles
476
+ security :
477
+ - bearer : []
478
+ parameters :
479
+ - $ref : ' #/components/parameters/memberId'
480
+ requestBody :
481
+ $ref : ' #/components/requestBodies/GroupRoleBodyParam'
482
+ responses :
483
+ 204 :
484
+ description : The resource was deleted successfully.
485
+ 400 :
486
+ $ref : " #/components/responses/BadRequest"
487
+ 401 :
488
+ $ref : " #/components/responses/Unauthenticated"
489
+ 403 :
490
+ $ref : " #/components/responses/Forbidden"
491
+ 500 :
492
+ $ref : " #/components/responses/InternalServerError"
368
493
369
494
/groups/health :
370
495
get :
@@ -400,6 +525,14 @@ components:
400
525
schema :
401
526
type : string
402
527
example : ' 10ba038e-48da-123b-96e8-8d3b99b6d18a'
528
+ subGroupId :
529
+ name : subGroupId
530
+ in : path
531
+ description : The sub group id.
532
+ required : true
533
+ schema :
534
+ type : string
535
+ example : ' 10ba038e-48da-123b-96e8-8d3b99b6d18a'
403
536
oldId :
404
537
name : oldId
405
538
in : path
@@ -617,10 +750,15 @@ components:
617
750
content :
618
751
application/json :
619
752
schema :
620
- type : object
621
- properties :
622
- result :
623
- $ref : ' #/components/schemas/Group'
753
+ $ref : ' #/components/schemas/Group'
754
+ GroupMemberRoleResponse :
755
+ description : The group role response
756
+ content :
757
+ application/json :
758
+ schema :
759
+ type : array
760
+ items :
761
+ $ref : ' #/components/schemas/GroupRole'
624
762
625
763
schemas :
626
764
GroupMembership :
@@ -695,6 +833,24 @@ components:
695
833
type : array
696
834
items :
697
835
$ref : ' #/components/schemas/Group'
836
+
837
+ GroupRole :
838
+ description : The group role entity
839
+ properties :
840
+ groupId :
841
+ type : string
842
+ description : The group id
843
+ role :
844
+ type : string
845
+ enum : ['groupManager', 'groupAdmin']
846
+ description : The group role
847
+ createdAt :
848
+ type : string
849
+ format : date-time
850
+ description : The time the group role created at
851
+ createdBy :
852
+ type : string
853
+ description : The id of the user who created the group role
698
854
699
855
requestBodies :
700
856
NewGroupMembershipBodyParam :
@@ -738,4 +894,20 @@ components:
738
894
status :
739
895
type : string
740
896
enum : ['active', 'inactive']
741
- description : Value indicating the status of the group
897
+ description : Value indicating the status of the group
898
+ GroupRoleBodyParam :
899
+ description : A JSON object containing group role body information
900
+ required : true
901
+ content :
902
+ application/json :
903
+ schema :
904
+ type : object
905
+ properties :
906
+ groupId :
907
+ type : string
908
+ description : The group id
909
+ example : ' 10ba038e-48da-123b-96e8-8d3b99b6d18a'
910
+ role :
911
+ type : string
912
+ enum : ['groupManager', 'groupAdmin']
913
+ description : The group role
0 commit comments