mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-27 14:08:46 +00:00
refactor: replace adminProcedure with enterpriseProcedure in whitelabeling router for enhanced access control
This commit is contained in:
@@ -5,10 +5,14 @@ import {
|
|||||||
} from "@dokploy/server";
|
} from "@dokploy/server";
|
||||||
import { TRPCError } from "@trpc/server";
|
import { TRPCError } from "@trpc/server";
|
||||||
import { apiUpdateWhitelabeling } from "@/server/db/schema";
|
import { apiUpdateWhitelabeling } from "@/server/db/schema";
|
||||||
import { adminProcedure, createTRPCRouter, publicProcedure } from "../../trpc";
|
import {
|
||||||
|
createTRPCRouter,
|
||||||
|
enterpriseProcedure,
|
||||||
|
publicProcedure,
|
||||||
|
} from "../../trpc";
|
||||||
|
|
||||||
export const whitelabelingRouter = createTRPCRouter({
|
export const whitelabelingRouter = createTRPCRouter({
|
||||||
get: adminProcedure.query(async () => {
|
get: enterpriseProcedure.query(async () => {
|
||||||
if (IS_CLOUD) {
|
if (IS_CLOUD) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -16,7 +20,7 @@ export const whitelabelingRouter = createTRPCRouter({
|
|||||||
return settings?.whitelabelingConfig ?? null;
|
return settings?.whitelabelingConfig ?? null;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
update: adminProcedure
|
update: enterpriseProcedure
|
||||||
.input(apiUpdateWhitelabeling)
|
.input(apiUpdateWhitelabeling)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
if (IS_CLOUD) {
|
if (IS_CLOUD) {
|
||||||
@@ -40,7 +44,7 @@ export const whitelabelingRouter = createTRPCRouter({
|
|||||||
return { success: true };
|
return { success: true };
|
||||||
}),
|
}),
|
||||||
|
|
||||||
reset: adminProcedure.mutation(async ({ ctx }) => {
|
reset: enterpriseProcedure.mutation(async ({ ctx }) => {
|
||||||
if (IS_CLOUD) {
|
if (IS_CLOUD) {
|
||||||
throw new TRPCError({
|
throw new TRPCError({
|
||||||
code: "BAD_REQUEST",
|
code: "BAD_REQUEST",
|
||||||
|
|||||||
Reference in New Issue
Block a user