Skip to content

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.

552 B
Raw Blame
-- Fix shipment RLS policies to use inventory permissions instead of sales permissions
DROP POLICY "UPDATE" ON "shipment";
DROP POLICY "DELETE" ON "shipment";

CREATE POLICY "UPDATE" ON "shipment"
FOR UPDATE USING (
 "companyId" = ANY (
      (
        SELECT
          get_companies_with_employee_permission ('inventory_update')
      )::text[]
    )
);

CREATE POLICY "DELETE" ON "shipment"
FOR DELETE USING (
  "companyId" = ANY (
      (
        SELECT
          get_companies_with_employee_permission ('inventory_delete')
      )::text[]
    )
);