diff --git a/server/routers/integration.ts b/server/routers/integration.ts index 8fa5c25c..fc66a88d 100644 --- a/server/routers/integration.ts +++ b/server/routers/integration.ts @@ -280,6 +280,13 @@ authenticated.delete( role.deleteRole ); +authenticated.get( + "/role/:roleId", + verifyApiKeyRoleAccess, + verifyApiKeyHasAction(ActionsEnum.getRole), + role.getRole +); + authenticated.post( "/role/:roleId/add/:userId", verifyApiKeyRoleAccess, diff --git a/server/routers/role/getRole.ts b/server/routers/role/getRole.ts index b7e9539f..66dbb68f 100644 --- a/server/routers/role/getRole.ts +++ b/server/routers/role/getRole.ts @@ -8,6 +8,7 @@ import HttpCode from "@server/types/HttpCode"; import createHttpError from "http-errors"; import logger from "@server/logger"; import { fromError } from "zod-validation-error"; +import { OpenAPITags, registry } from "@server/openApi"; const getRoleSchema = z .object({ @@ -15,6 +16,17 @@ const getRoleSchema = z }) .strict(); +registry.registerPath({ + method: "get", + path: "/role/{roleId}", + description: "Get a role.", + tags: [OpenAPITags.Role], + request: { + params: getRoleSchema + }, + responses: {} +}); + export async function getRole( req: Request, res: Response,