edit functions with cancan permission