title: Firebase - Allow user access to parts of database based on database information
body: <p>I know how you can give a user read/write access to parts of the database using his UID, but I want to do something that is a little but more complicated, and I don't know how to do it. If I have a database structure like this:</p>
  
  <ul>
  <li><p>Users:</p>
  
  <ul>
  <li><p>oixMNpuyaaTTntNVl17MC74wL8e2:</p>
  
  <ul>
  <li>accesTo: 
  
  <ul>
  <li>Some Name: 'some value'</li>
  <li>Some Other Name: 'some other value'</li>
  </ul></li>
  </ul></li>
  </ul></li>
  <li>Stuff
  
  <ul>
  <li>Some Name
  
  <ul>
  <li>Information: 'More information'</li>
  <li>InformationMore: 'Some more information'</li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>In this case, I need user <code>oixMNpuyaaTTntNVl17MC74wL8e2</code> to be able to access all the data under <code>Some Name</code>, which was specified somewhere else in the database. I hope I was able to explain my issue properly, and that this is possible! Also, it is not okay to set the <code>Some Name</code> child of <code>Stuff</code> to <code>oixMNpuyaaTTntNVl17MC74wL8e2</code>, because other users might also have access to <code>Some Name</code>.</p>
  
  <p>Note: I'm using Firebase Web and Admin as well, using Python (Flask) and JavaScript.</p>