mirror of
https://github.com/fosrl/pangolin.git
synced 2025-08-29 06:08:15 +02:00
add get role to integration api
This commit is contained in:
parent
96b451843c
commit
4593edbb45
2 changed files with 19 additions and 0 deletions
|
@ -280,6 +280,13 @@ authenticated.delete(
|
||||||
role.deleteRole
|
role.deleteRole
|
||||||
);
|
);
|
||||||
|
|
||||||
|
authenticated.get(
|
||||||
|
"/role/:roleId",
|
||||||
|
verifyApiKeyRoleAccess,
|
||||||
|
verifyApiKeyHasAction(ActionsEnum.getRole),
|
||||||
|
role.getRole
|
||||||
|
);
|
||||||
|
|
||||||
authenticated.post(
|
authenticated.post(
|
||||||
"/role/:roleId/add/:userId",
|
"/role/:roleId/add/:userId",
|
||||||
verifyApiKeyRoleAccess,
|
verifyApiKeyRoleAccess,
|
||||||
|
|
|
@ -8,6 +8,7 @@ import HttpCode from "@server/types/HttpCode";
|
||||||
import createHttpError from "http-errors";
|
import createHttpError from "http-errors";
|
||||||
import logger from "@server/logger";
|
import logger from "@server/logger";
|
||||||
import { fromError } from "zod-validation-error";
|
import { fromError } from "zod-validation-error";
|
||||||
|
import { OpenAPITags, registry } from "@server/openApi";
|
||||||
|
|
||||||
const getRoleSchema = z
|
const getRoleSchema = z
|
||||||
.object({
|
.object({
|
||||||
|
@ -15,6 +16,17 @@ const getRoleSchema = z
|
||||||
})
|
})
|
||||||
.strict();
|
.strict();
|
||||||
|
|
||||||
|
registry.registerPath({
|
||||||
|
method: "get",
|
||||||
|
path: "/role/{roleId}",
|
||||||
|
description: "Get a role.",
|
||||||
|
tags: [OpenAPITags.Role],
|
||||||
|
request: {
|
||||||
|
params: getRoleSchema
|
||||||
|
},
|
||||||
|
responses: {}
|
||||||
|
});
|
||||||
|
|
||||||
export async function getRole(
|
export async function getRole(
|
||||||
req: Request,
|
req: Request,
|
||||||
res: Response,
|
res: Response,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue