change type to role in user, and update user.rb