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