I'm working on a iOS-app with FirebaseAuth and FirebaseDatabase. To identify the correct Node in the Database, where the logged in user saves his Data, I use the uid key of the User-Object from FirebaseAuth. The problem I'm facing now is, that I want to allow the users to share their Databases with other Teammembers. So the Idea in general is: One user Signs up and creates the virtual database, means a new node in the whole Database. Then other users can sign up with some sort of key or anything and join the virtual database, where they have the same rights, means they can read and edit the data. The easiest way would be to create a node where I store the new users uid and the database uid, but I'm a bit concerned about the security of that. Can I just share the UID of the owning user? Is there any general approach?
Another idea I had was that the "Main User" can invite other users, either with just entering their email or with creating a new user object on firebase where the users can reset the password.
Thank you!