Write user model with password protection