set permit function before action