refactor: update roles

This commit is contained in:
Mauricio Siu
2025-02-15 19:23:08 -06:00
parent d233f2c764
commit 1c5cc5a0db
45 changed files with 141 additions and 132 deletions

View File

@@ -44,7 +44,7 @@ export const postgresRouter = createTRPCRouter({
.input(apiCreatePostgres)
.mutation(async ({ input, ctx }) => {
try {
if (ctx.user.rol === "user") {
if (ctx.user.rol === "member") {
await checkServiceAccess(ctx.user.id, input.projectId, "create");
}
@@ -63,7 +63,7 @@ export const postgresRouter = createTRPCRouter({
});
}
const newPostgres = await createPostgres(input);
if (ctx.user.rol === "user") {
if (ctx.user.rol === "member") {
await addNewService(ctx.user.id, newPostgres.postgresId);
}
@@ -90,7 +90,7 @@ export const postgresRouter = createTRPCRouter({
one: protectedProcedure
.input(apiFindOnePostgres)
.query(async ({ input, ctx }) => {
if (ctx.user.rol === "user") {
if (ctx.user.rol === "member") {
await checkServiceAccess(ctx.user.id, input.postgresId, "access");
}
@@ -221,7 +221,7 @@ export const postgresRouter = createTRPCRouter({
remove: protectedProcedure
.input(apiFindOnePostgres)
.mutation(async ({ input, ctx }) => {
if (ctx.user.rol === "user") {
if (ctx.user.rol === "member") {
await checkServiceAccess(ctx.user.id, input.postgresId, "delete");
}
const postgres = await findPostgresById(input.postgresId);