edit function check permisson