feat: add userConfig claims
This commit is contained in:
@@ -6,7 +6,7 @@ export async function userConfigRoutes(fastify: FastifyInstance) {
|
||||
fastify.get(
|
||||
"/",
|
||||
{
|
||||
config: { requiredClaims: ["config:read"] },
|
||||
config: { requiredClaims: ["userConfig:read"] },
|
||||
preHandler: [fastify.authorize],
|
||||
},
|
||||
getConfigHandler
|
||||
@@ -18,7 +18,7 @@ export async function userConfigRoutes(fastify: FastifyInstance) {
|
||||
schema: {
|
||||
body: $userConfig("updateUserConfigInput"),
|
||||
},
|
||||
config: { requiredClaims: ["config:write"] },
|
||||
config: { requiredClaims: ["userConfig:write"] },
|
||||
preHandler: [fastify.authorize],
|
||||
},
|
||||
updateConfigHandler
|
||||
|
||||
@@ -28,6 +28,8 @@ export type Claim =
|
||||
| "notification:delete"
|
||||
| "config:read"
|
||||
| "config:write"
|
||||
| "userConfig:read"
|
||||
| "userConfig:write"
|
||||
| "mail:all"
|
||||
| "view:read"
|
||||
| "view:write"
|
||||
|
||||
@@ -29,6 +29,8 @@ export const rules: Record<
|
||||
"notification:delete",
|
||||
"config:read",
|
||||
"config:write",
|
||||
"userConfig:read",
|
||||
"userConfig:write",
|
||||
"mail:all",
|
||||
"view:read",
|
||||
"view:write",
|
||||
@@ -70,6 +72,8 @@ export const rules: Record<
|
||||
"notification:delete",
|
||||
"config:read",
|
||||
"config:write",
|
||||
"userConfig:read",
|
||||
"userConfig:write",
|
||||
"mail:all",
|
||||
"view:read",
|
||||
"view:write",
|
||||
@@ -104,6 +108,8 @@ export const rules: Record<
|
||||
"notification:read",
|
||||
"notification:delete",
|
||||
"config:read",
|
||||
"userConfig:read",
|
||||
"userConfig:write",
|
||||
"mail:all",
|
||||
"view:read",
|
||||
"view:write",
|
||||
@@ -146,6 +152,8 @@ export const rules: Record<
|
||||
"payment:read",
|
||||
"alert:read",
|
||||
"alert:write",
|
||||
"userConfig:read",
|
||||
"userConfig:write",
|
||||
],
|
||||
hiddenFields: {
|
||||
orgs: ["__v"],
|
||||
|
||||
Reference in New Issue
Block a user