title: Firebase + Ask Permission From User Before Adding This User To The List
body: <p>I am in the process of creating an android application which uses Firebase. I am actually new to Firebase and I was searching on how to do the below features. I couldn't find a specific answer or the ones I found, I couldn't understand them well. If anyone can answer them, I will really appreciate it. :)</p>
  
  <p><strong>Features:</strong></p>
  
  <p><strong>Feature 1</strong>: In my application when User A adds User B. I want the User B to get a notification, something like, "User A wants to add you as a friend." If User B confirms it then and only then should User B be added to User A's "friend-list" and vice-versa. If User B rejects, then the opposite should happen. Also, when User B removes User A from the "friend-list", both of them should be deleted from each other's "friend=list" and a notification of the said should happen.</p>
  
  <p><strong>Feature 2</strong>: I want the same to happen now but this time I want User Z to be the admin of User B and now when User A wants to add User B. The notification should go to User Z as well as User B. But rejecting it or accepting it should depend on User Z alone. So here it's between User A and User Z.</p>
  
  <p>I want to know if I should use triggers in the Firebase database to achieve this or should I use the 'Security Features' of Firebase. I am sure there is a way to do this. I appreciate the help. :)</p>