MCPcopy
hub / github.com/Dokploy/dokploy / withPermission

Function withPermission

apps/dokploy/server/api/trpc.ts:258–265  ·  view source on GitHub ↗
(
	resource: R,
	action: ActionOf<R>,
)

Source from the content-addressed store, hash-verified

256 * .mutation(async ({ ctx, input }) => { ... })
257 */
258export const withPermission = <R extends Resource>(
259 resource: R,
260 action: ActionOf<R>,
261) =>
262 protectedProcedure.use(async ({ ctx, next }) => {
263 await checkPermission(ctx, { [resource]: [action] } as any);
264 return next();
265 });

Callers 15

domain.tsFile · 0.90
deployment.tsFile · 0.90
gitea.tsFile · 0.90
gitlab.tsFile · 0.90
github.tsFile · 0.90
backup.tsFile · 0.90
certificate.tsFile · 0.90
user.tsFile · 0.90
registry.tsFile · 0.90
destination.tsFile · 0.90
application.tsFile · 0.90
stripe.tsFile · 0.90

Calls 1

checkPermissionFunction · 0.90

Tested by

no test coverage detected