class AttributeService {

	public InternalFeature getAttributes(VectorLayer layer, InternalFeature feature, Object featureBean)
			throws LayerException {
		String layerId = layer.getId();

		Map<String, Attribute> featureAttributes = getRealAttributes(layer, featureBean);
		feature.setAttributes(featureAttributes); // to allow isAttributeReadable to see full object
		addSyntheticAttributes(feature, featureAttributes, layer);
		if (securityContext.isFeatureVisible(layerId, feature)) {

			feature.setAttributes(filterAttributes(layerId, layer.getLayerInfo().getFeatureInfo().getAttributesMap(),
					feature, featureAttributes));

			feature.setEditable(securityContext.isFeatureUpdateAuthorized(layerId, feature));
			feature.setDeletable(securityContext.isFeatureDeleteAuthorized(layerId, feature));

			return feature;
		}
		return null;
	}

}