As you're probably aware, you can't edit many-to-many relationships with inline formsets. You can, however, edit the through model. So for your inline formset, you just need to set the model to the through model, like so:
RoleFormSet = inlineformset_factory(UserRole, User.role.through)