// populate the access manager
TestResourceAccessManager tam = (TestResourceAccessManager) applicationContext
.getBean("testResourceAccessManager");
// hide the layer to cite_nostates
tam.putLimits("cite_nostates", states, new WMSAccessLimits(CatalogMode.HIDE,
Filter.EXCLUDE, null, false));
// disallow getfeatureinfo on the states layer
tam.putLimits("cite_noinfo", states, new WMSAccessLimits(CatalogMode.HIDE, Filter.INCLUDE,
null, false));
// cascade CQL filter, allow feature info
FilterFactory ff = CommonFactoryFinder.getFilterFactory(null);
Filter texas = ff.equal(ff.property("STATE_NAME"), ff.literal("Texas"), false);
tam.putLimits("cite_texas", states,
new WMSAccessLimits(CatalogMode.HIDE, texas, null, true));
}