mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-29 22:32:11 +00:00
Improve ingame moderation for admins (#3678)
## Description: Players with the `admin` flare can now kick players from any game (including public lobbies), not just the lobby creator in private lobbies. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: w.o.n
This commit is contained in:
@@ -51,6 +51,11 @@ export const TokenPayloadSchema = z.object({
|
||||
});
|
||||
export type TokenPayload = z.infer<typeof TokenPayloadSchema>;
|
||||
|
||||
export const ADMIN_ROLES = ["admin", "root"] as const;
|
||||
export function isAdminRole(role: string | null | undefined): boolean {
|
||||
return role === "admin" || role === "root";
|
||||
}
|
||||
|
||||
export const DiscordUserSchema = z.object({
|
||||
id: z.string(),
|
||||
avatar: z.string().nullable(),
|
||||
@@ -72,7 +77,6 @@ export const UserMeResponseSchema = z.object({
|
||||
}),
|
||||
player: z.object({
|
||||
publicId: z.string(),
|
||||
roles: z.string().array().optional(),
|
||||
flares: z.string().array().optional(),
|
||||
achievements: z.object({
|
||||
singleplayerMap: z.array(SingleplayerMapAchievementSchema),
|
||||
|
||||
Reference in New Issue
Block a user