Fix reset permissions function: refresh object after update and prevent reset before changes are saved.