mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 01:52:22 +00:00
feat(rbac): implemented backend base apis for rbac permission system
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export * from "./user";
|
||||
export * from "./role";
|
||||
export * from "./workspace";
|
||||
export * from "./bot";
|
||||
export * from "./integration";
|
||||
@@ -8,4 +9,4 @@ export * from "./membershipOrg";
|
||||
export * from "./organization";
|
||||
export * from "./secrets";
|
||||
export * from "./serviceAccount";
|
||||
export * from "./serviceTokenData";
|
||||
export * from "./serviceTokenData";
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
import { z } from "zod";
|
||||
|
||||
export const CreateRoleSchema = z.object({
|
||||
body: z.object({
|
||||
slug: z.string(),
|
||||
name: z.string(),
|
||||
description: z.string().optional(),
|
||||
workspaceId: z.string().optional(),
|
||||
orgId: z.string(),
|
||||
permissions: z
|
||||
.object({
|
||||
subject: z.string(),
|
||||
action: z.string(),
|
||||
condition: z.record(z.union([z.string(), z.number()]))
|
||||
})
|
||||
.array()
|
||||
})
|
||||
});
|
||||
|
||||
export const UpdateRoleSchema = z.object({
|
||||
params: z.object({
|
||||
id: z.string()
|
||||
}),
|
||||
body: z.object({
|
||||
slug: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
description: z.string().optional(),
|
||||
workspaceId: z.string().optional(),
|
||||
orgId: z.string(),
|
||||
permissions: z
|
||||
.object({
|
||||
subject: z.string(),
|
||||
action: z.string(),
|
||||
condition: z.record(z.union([z.string(), z.number()]))
|
||||
})
|
||||
.array()
|
||||
.optional()
|
||||
})
|
||||
});
|
||||
|
||||
export const DeleteRoleSchema = z.object({
|
||||
params: z.object({
|
||||
id: z.string()
|
||||
})
|
||||
});
|
||||
|
||||
export const GetRoleSchema = z.object({
|
||||
query: z.object({
|
||||
workspaceId: z.string().optional(),
|
||||
orgId: z.string()
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user