Add the ability to have global named filters with resource-specific mappings of the filters. For example, we may have a global "organizationFilter" which specifies that it takes one parameter, "orgId", which is the organization of the current user and should be the owning organization of the data returned by the index. For an Organization record, this is as simple as comparing the org.getId() with the supplied "orgId". For a catalog item, it might be: item.getVendorProfile().getOrganization().getId().
In the main compass config, you could map a global filter like this:
<filter-def name="organizationFilter">
<filter-param name="orgId" type="string" />
</filter-def>
then, in a specific resource mapping, the filter would be applied like this:
<filter ref="organizationFilter">
item.vendorProfile.organization.id = :orgId
</filter>
Similarly for an effectivity filter:
<filter-def name="effectivityFilter">
<filter-param name="asOfDate" type="date" />
</filter-def>
<filter ref="effectivityFilter">
startDate <= :asOfDate <= endDate
</filter>
Not sure how you do that last one...