move action permission check to middleware

This commit is contained in:
Milo Schwartz 2024-11-05 23:55:46 -05:00
parent 74bb7b9291
commit d18ceac59c
48 changed files with 266 additions and 936 deletions

View file

@ -6,10 +6,9 @@ import { orgs, userOrgs } from "@server/db/schema";
import response from "@server/utils/response";
import HttpCode from "@server/types/HttpCode";
import createHttpError from "http-errors";
import { ActionsEnum, checkUserActionPermission } from "@server/auth/actions";
import logger from "@server/logger";
import { createAdminRole } from "@server/db/ensureActions";
import config, { APP_PATH } from "@server/config";
import config from "@server/config";
import { fromError } from "zod-validation-error";
const createOrgSchema = z.object({