I have a question about how to save M2M relations. One side must be always the owning side. In our scenario we have a entity "Role" and a entity "User". A Role can have many users and users can be assigned to different roles. The "Role" entity is the owning site.
In the Gui the Administrator can add users to a role. When I save the role with the assigned users everything works well. Now we should provide a way to assign roles to users. The Gui for this is no problem but I don't know how to save the changed role assignments. Saving the user doesn't save the assigned roles because it is not the owning side.
Is there another way to do this? I'm not sure but I think the only way to do this is to add the selected user to all assigned roles and save the roles.