Fixed csrf token error, fixed permissions update