@@ -759,9 +759,14 @@ paths:
759
759
/user/{sessionId}/ban :
760
760
post :
761
761
tags : [Users]
762
- summary : Bans or unbans a user.
762
+ summary : Bans a user.
763
763
description : >
764
- Applies or removes a ban of a user from specific rooms, or from the server globally.
764
+ Applies a ban of a user from specific rooms, or from the server globally.
765
+
766
+
767
+ The invoking user must have moderator (or admin) permission in all given rooms when
768
+ specifying `rooms`, and must be a global server moderator (or admin) if using the `global`
769
+ parameter.
765
770
766
771
767
772
Note that the given session ID does not have to exist: it is possible to preemptively ban
@@ -774,7 +779,7 @@ paths:
774
779
parameters :
775
780
- $ref : " #/components/parameters/pathSessionId"
776
781
requestBody :
777
- description : Details of the ban to apply. To unban a user, specify a negative timeout.
782
+ description : Details of the ban to apply.
778
783
required : true
779
784
content :
780
785
application/json :
@@ -791,6 +796,12 @@ paths:
791
796
be a moderator (or admin) of all of the given rooms.
792
797
793
798
799
+ You can specify a single element list `["*"]` to ban the user from all rooms on
800
+ the server to which the calling user has moderator permissions. This differs
801
+ from a global ban in that it doesn't apply to non-moderator-permission rooms,
802
+ nor does it apply to newly created rooms or non-room endpoints.
803
+
804
+
794
805
Exclusive of `global`.
795
806
global :
796
807
type : boolean
@@ -799,22 +810,20 @@ paths:
799
810
user must be a server-level moderator or admin.
800
811
801
812
813
+ The ban applies immediately to all server requests initiated by the user (not
814
+ just room access).
815
+
816
+
802
817
Exclusive of `rooms`.
803
818
timeout :
804
819
type : number
805
820
format : double
806
821
nullable : true
807
822
example : 86400
808
823
description : >
809
- How long the ban should apply, in seconds. If there is an existing ban on the
810
- user in the given rooms or globally this updates the existing expiry to the
811
- given value. If omitted or `null` the ban does not expire.
812
-
813
- If this value is set to a negative value (`-1` is suggested) then any existing
814
- bans for this user are *removed* from the given rooms/server. Note, however,
815
- that server bans and room bans are independent: removing a server-level ban does
816
- not remove room-specific bans, and removing a room-level ban will not grant room
817
- access to a user who also has a server-level ban.
824
+ How long the ban should apply, in seconds. If omitted (or `null`) then the ban
825
+ applies forever. If an unban was previously scheduled then it is replaced (if a
826
+ timeout is given) or deleted (if no timeout is provided).
818
827
examples :
819
828
tworooms :
820
829
summary : " 1-day ban from two rooms"
@@ -825,21 +834,77 @@ paths:
825
834
summary : " Permanent server ban"
826
835
value :
827
836
global : true
828
- timeout : null
829
- delete_all : true
830
- unban :
831
- summary : " Unban a user from a room"
832
- value :
833
- rooms : ["lokinet"]
834
- global : false,
835
- timeout : -1
836
837
responses :
837
838
200 :
838
839
description : Ban applied successfully.
839
840
content : {}
840
841
403 :
841
842
description : >
842
- Permission denied. The user attempting to set the ban does not have moderator
843
+ Permission denied. The user attempting to set the ban does not have the required
844
+ moderator permissions for one or more of the given rooms (or server moderator permission
845
+ for a global ban).
846
+ content : {}
847
+ /user/{sessionId}/unban :
848
+ post :
849
+ tags : [Users]
850
+ summary : Removes a user ban.
851
+ description : >
852
+ Removes a room-specific or global ban of a user.
853
+
854
+
855
+ Note that removing a room-specific ban does not affect an existing global ban, and removing
856
+ a global ban does not affect existing room-specific bans.
857
+ parameters :
858
+ - $ref : " #/components/parameters/pathSessionId"
859
+ requestBody :
860
+ description : Details of the ban to remove.
861
+ required : true
862
+ content :
863
+ application/json :
864
+ schema :
865
+ type : object
866
+ properties :
867
+ rooms :
868
+ type : array
869
+ items :
870
+ $ref : " #/components/schemas/RoomToken"
871
+ minItems : 1
872
+ description : >
873
+ List of room tokens from which the ban should be removed (if present). The
874
+ invoking user must be a moderator (or admin) of all of the given rooms.
875
+
876
+
877
+ You can specify a single element list `["*"]` to unban the user from all rooms
878
+ on the server to which the calling user has moderator permissions. This isn't
879
+ the same as removing a global ban; this just removes any room-specific bans that
880
+ may currently apply from moderated rooms.
881
+
882
+
883
+ Exclusive of `global`.
884
+ global :
885
+ type : boolean
886
+ description : >
887
+ If true then remove a global server ban of this user. The invoking user must be
888
+ a server-level moderator or admin.
889
+
890
+
891
+ Exclusive of `rooms`.
892
+ examples :
893
+ tworooms :
894
+ summary : " Remove ban from two rooms"
895
+ value :
896
+ rooms : ["session", "lokinet"]
897
+ permaban :
898
+ summary : " Remove server ban"
899
+ value :
900
+ global : true
901
+ responses :
902
+ 200 :
903
+ description : Ban removed successfully.
904
+ content : {}
905
+ 403 :
906
+ description : >
907
+ Permission denied. The user attempting to remove the ban does not have moderator
843
908
permissions for one or more of the given rooms (or server moderator permission for a
844
909
global ban).
845
910
content : {}
0 commit comments