Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
refactor: update requirePermissions check to include current company
Brad Barbincc21f166dd01
diff --git a/apps/carbon/app/services/auth/auth.server.ts b/apps/carbon/app/services/auth/auth.server.tsindex 4ac12d9977..bd7baeb9d9 100644--- a/apps/carbon/app/services/auth/auth.server.ts+++ b/apps/carbon/app/services/auth/auth.server.ts@@ -113,14 +113,20 @@ export async function requirePermissions(myClaims.permissions[permission][action as "view" | "create" | "update" | "delete"];- return permissionForCompany.includes(0); // TODO: check if the user has access to the company+ return (+ permissionForCompany.includes(0) || // 0 is the wildcard for all companies+ permissionForCompany.includes(companyId)+ );} else if (Array.isArray(permission)) {return permission.every((p) => {const permissionForCompany =myClaims.permissions[p][action as "view" | "create" | "update" | "delete"];- return permissionForCompany.includes(0); // TODO: check if the user has access to the company+ return (+ permissionForCompany.includes(0) || // 0 is the wildcard for all companies+ permissionForCompany.includes(companyId)+ );});} else {return false;