handle relevant case

handle relevant case and add permission control