From 6a4fd5fbdb4791f37065c96173bdfacd561a825b Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Thu, 14 Dec 2023 22:09:25 -0500 Subject: add new right for creating registration tokens --- src/api/routes/auth/generate-registration-tokens.ts | 2 +- src/util/util/Rights.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/routes/auth/generate-registration-tokens.ts b/src/api/routes/auth/generate-registration-tokens.ts index 80fdaed1..50c389e0 100644 --- a/src/api/routes/auth/generate-registration-tokens.ts +++ b/src/api/routes/auth/generate-registration-tokens.ts @@ -38,7 +38,7 @@ router.get( "The length of each registration token. Defaults to 255.", }, }, - right: "OPERATOR", + right: "CREATE_REGISTRATION_TOKENS", responses: { 200: { body: "GenerateRegistrationTokensResponse" } }, }), async (req: Request, res: Response) => { diff --git a/src/util/util/Rights.ts b/src/util/util/Rights.ts index 90ebe242..56d0e28d 100644 --- a/src/util/util/Rights.ts +++ b/src/util/util/Rights.ts @@ -94,6 +94,7 @@ export class Rights extends BitField { MANAGE_GROUPS: BitFlag(47), // can manage others' groups VIEW_SERVER_STATS: BitFlag(48), // added per @chrischrome's request — can view server stats) RESEND_VERIFICATION_EMAIL: BitFlag(49), // can resend verification emails (/auth/verify/resend) + CREATE_REGISTRATION_TOKENS: BitFlag(50), // can create registration tokens (/auth/generate-registration-tokens) }; any(permission: RightResolvable, checkOperator = true) { -- cgit 1.4.1