Membranes with controllable permeation