missing FROM-clause entry for table "new"

I wrote RLS like so:
DROP POLICY IF EXISTS crm_rbac_insert ON public.crm;
CREATE POLICY crm_rbac_insert ON public.crm
  FOR INSERT
  TO authenticated
  WITH CHECK (
    public.rbac_organization_has_permission(
      (SELECT auth.uid()),
      NEW.organisation_id,
      'crm_create'
    )
  );

But I'm getting above error. I need that NEW because I have to check if user has role with permission allowing them to create new CRM
Was this page helpful?