title: How to set a specific rules in firebase realtime?
body: <p>I would like to put my rules in the database so that some tables can only be written by the admin. I'm having trouble with this :( could someone help me?</p>
  <p>Inside my user table I have an &quot;admin&quot; field: true.
  I would like the &quot;users&quot; and &quot;Vinyls&quot; tables to be modified only by the admin.</p>
  <p>At the moment I have set the following rules, but doing so I cannot modify the vinyls table.</p>
  <pre class="lang-js prettyprint-override"><code>{
   &quot;rules&quot;: {
      &quot;users&quot;: { 
          &quot;.read&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;,
           &quot;.write&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;
      },
      &quot;Vinyls&quot;:{
        &quot;.read&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;,
        &quot;.write&quot;:&quot;root.child('users').child(auth.id).child('admin').val()=='true'&quot;
      },
      &quot;WishList&quot;:{
        &quot;.read&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;,
        &quot;.write&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;
      },
      &quot;RatingUsersVinyls&quot;:{
        &quot;.read&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;,
        &quot;.write&quot;:&quot;root.child('users').child('uid').val()===auth.id&quot;
      }
    }
   }
  
  </code></pre>
  <p>users table:</p>
  <pre><code>{
   
    &quot;users&quot;: {
      &quot;Qi8HU8YFMLhKhvoiHLkR6ooqnOp2&quot;: {
        &quot;admin&quot;: true,
        &quot;email&quot;: &quot;admin@gmail.com&quot;,
        &quot;name&quot;: &quot;Admin&quot;,
        &quot;password&quot;: &quot;admin123&quot;,
        &quot;surname&quot;: &quot;Admin Surname&quot;
      },
      &quot;rTEp7K1cE8W4pZF9diB09ZxWfC72&quot;: {
        &quot;admin&quot;: false,
        &quot;email&quot;: &quot;testUser@hotmail.it&quot;,
        &quot;name&quot;: &quot;User&quot;,
        &quot;password&quot;: &quot;test123&quot;,
        &quot;surname&quot;: &quot;Test&quot;
      }
    }
  }
  
  </code></pre>
  <p>Vinyls table:</p>
  <pre><code>&quot;Vinyls&quot;: {
      &quot;v1&quot;: {
        &quot;author&quot;: &quot;Pink Floyd&quot;,
        &quot;description&quot;: &quot;A1 In The Flesh? , A2  The Thin Ice, A3   Another Brick In The Wall Part 1, A4 The Happiest Days Of Our Lives, A5 Another Brick In The Wall Part 2, A6\tMother, B1 Goodbye Blue Sky, B2 Empty Spaces, B3 Young Lust, B4\tOne Of My Turns, B5 Don't Leave Me Now, B6 Another Brick In The Wall Part 3,B7\t Goodbye Cruel World, C1\tHey You,C2\tIs There Anybody Out There?, C3 Nobody Home,C4 Vera,C5 Bring The Boys Back Home,C6 Comfortably Numb,D1 The Show Must Go On,D2 In The Flesh,D3\tRun Like Hell,D4 Waiting For The Worms,D5\tStop,D6\tThe Trial,D7\tOutside The Wall&quot;,
        &quot;genre&quot;: &quot;rock&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/L_VyYyJq5qz9dKeMRuRSGg3ftbl-sadWu4oaJotdn-M/rs:fit/g:sm/q:90/h:600/w:588/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTIwNDE2/MTgtMTM5MDY3OTAy/NS0yMzcyLmpwZWc.jpeg&quot;,
        &quot;name&quot;: &quot;The Wall&quot;,
        &quot;price&quot;: &quot;20&quot;,
        &quot;youtubeLink&quot;: &quot;https://www.youtube.com/playlist?list=OLAK5uy_nE3dmeYl_9Jgv2CT0aqufkDcyB6BBMcGM&quot;
      },
      &quot;v2&quot;: {
        &quot;author&quot;: &quot;Tresor&quot;,
        &quot;description&quot;: &quot;E1 –Joey Beltram Ball Park (DJ Rush First Bass Mix), E2  –Joey Beltram Game Form (Mike Dearborn Remix),F1  –3 Phase Feat. Dr.,F2 –Ingator  Skyscratch (Mano Mano),G1 –K.Hand*  Mystery,G2  –Marshall Jefferson Floating,H1 –3MB Feat. Juan Atkins  Die Kosmischen Kuriere,H2 –Eddie Flashin' Fowlkes* &amp; Blake Baxter Wisdom&quot;,
        &quot;genre&quot;: &quot;TechnoX&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/gpDw1iNqHNRbzb3M_z6unHWMc_T2nnx4SoiymIuu02Y/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTMyMjk0/LTEyNTUzMDEwNjgu/anBlZw.jpeg&quot;,
        &quot;name&quot;: &quot;Various ‎– True Spirit. Part II&quot;,
        &quot;price&quot;: &quot;25&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/kyYOk-irg_Y&quot;
      },
      &quot;v3&quot;: {
        &quot;author&quot;: &quot;The Hacker&quot;,
        &quot;description&quot;: &quot;A1  Propagande, A2  Still ,B1  La Marine ,B2  Propagande V2&quot;,
        &quot;genre&quot;: &quot;Electro, House, Techno&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/IltPMOL6d_JFSF4mT-U9SkZ5WyJ2WERAfp4UXAq4lLU/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTEwNDAz/Nzk0LTE0OTY3NTg5/NDMtNDQ5Ny5wbmc.jpeg&quot;,
        &quot;name&quot;: &quot;Propagande EP&quot;,
        &quot;price&quot;: &quot;67&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/QQRBdMQEMDM&quot;
      },
      &quot;v4&quot;: {
        &quot;author&quot;: &quot;Dettmann* | Klock*&quot;,
        &quot;description&quot;: &quot;A1 Phantom Studies ,B1  No One Around ,B2  The Room  ,C1  Prophet Man ,C2  Bad Boy ,D1  The World Tonight ,D2  The Tenant&quot;,
        &quot;genre&quot;: &quot;Techno&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/jPsplJDJJjZ0U1ZANW-1DFiyorKAjzy01cS7QFqgo9I/rs:fit/g:sm/q:90/h:600/w:600/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTk2NDE4/NjUtMTQ4NDA3NjM1/OS00MDIwLmpwZWc.jpeg&quot;,
        &quot;name&quot;: &quot;Phantom Studies&quot;,
        &quot;price&quot;: &quot;55&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/dsiZO6oAekE&quot;
      },
      &quot;v5&quot;: {
        &quot;author&quot;: &quot;Adiel&quot;,
        &quot;description&quot;: &quot;A1  Method  ,A2  Mad ,B1  Time Is Out ,B2  In Your Power&quot;,
        &quot;genre&quot;: &quot;Techno&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/9gKf_bXz5gLn4peUqdeQi3WS9Vmie82tM7cAUB1o-ks/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTE4OTE0/NTM2LTE2MjIxOTA1/NDMtMTk3NS5qcGVn.jpeg&quot;,
        &quot;name&quot;: &quot;Method EP&quot;,
        &quot;price&quot;: &quot;20&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/-Hgk_LgZ5lw&quot;
      },
      &quot;v6&quot;: {
        &quot;author&quot;: &quot;Fadi Mohem&quot;,
        &quot;description&quot;: &quot;A1 Moving On ,A2  Reinforced  ,B1  RS-290  ,B2  Horus&quot;,
        &quot;genre&quot;: &quot;Techno&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/O5BE45prwmh1Xm3KBeJEizPLQeLqjI2MR6tAc-hANCU/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTEyMjgx/NDg5LTE2MzU0MzEy/NTItMTUwNC5qcGVn.jpeg&quot;,
        &quot;name&quot;: &quot;Reinforced&quot;,
        &quot;price&quot;: &quot;35&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/Se2lDHsffUk&quot;
      },
      &quot;v7&quot;: {
        &quot;author&quot;: &quot;PSYK&quot;,
        &quot;description&quot;: &quot;A1  Distane ,A2  Isolate ,B1  Rdmn  ,B2  Main&quot;,
        &quot;genre&quot;: &quot;Techno&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/z8ORhybojMioq2zuApKcQw64BOj1NZYy5BRp61o3HxE/rs:fit/g:sm/q:40/h:300/w:300/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTM4NjIx/MjItMTM2MDUwNjM5/MC02MjIzLmpwZWc.jpeg&quot;,
        &quot;name&quot;: &quot;Distane E.P.&quot;,
        &quot;price&quot;: &quot;15&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/2qDCoLvBaVo&quot;
      },
      &quot;v8&quot;: {
        &quot;author&quot;: &quot;Sterac Electronics &quot;,
        &quot;description&quot;: &quot;A Keep On Running ,B1  Destination Reached ,B2  Next Destination (Dub)&quot;,
        &quot;genre&quot;: &quot;Techno&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/VQ0Q_PEJLllfK5tga85qnHeCx7KyqOOdcqIvstt6_ss/rs:fit/g:sm/q:90/h:600/w:600/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTIxNjE4/OC0xMjAwMzIwMjE4/LmpwZWc.jpeg&quot;,
        &quot;name&quot;: &quot;Keep On Running&quot;,
        &quot;price&quot;: &quot;42&quot;,
        &quot;youtubeLink&quot;: &quot;https://youtu.be/7RHqlCwz2jU&quot;
      }
    }
  </code></pre>
  <p>WishList table:</p>
  <pre><code>&quot;WishList&quot;: {
      &quot;-N5nJXczFMxIzVdOUtMc&quot;: {
        &quot;author&quot;: &quot;Pink Floyd&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/L_VyYyJq5qz9dKeMRuRSGg3ftbl-sadWu4oaJotdn-M/rs:fit/g:sm/q:90/h:600/w:588/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTIwNDE2/MTgtMTM5MDY3OTAy/NS0yMzcyLmpwZWc.jpeg&quot;,
        &quot;name&quot;: &quot;The Wall&quot;,
        &quot;price&quot;: &quot;20$&quot;,
        &quot;userId&quot;: &quot;Qi8HU8YFMLhKhvoiHLkR6ooqnOp2&quot;,
        &quot;vinylId&quot;: &quot;v1&quot;
      },
      &quot;-N5p9QJucK2kGs0EMhBO&quot;: {
        &quot;author&quot;: &quot;Pink Floyd&quot;,
        &quot;imgSrc&quot;: &quot;https://i.discogs.com/L_VyYyJq5qz9dKeMRuRSGg3ftbl-sadWu4oaJotdn-M/rs:fit/g:sm/q:90/h:600/w:588/czM6Ly9kaXNjb2dz/LWRhdGFiYXNlLWlt/YWdlcy9SLTIwNDE2/MTgtMTM5MDY3OTAy/NS0yMzcyLmpwZWc.jpeg&quot;,
        &quot;name&quot;: &quot;The Wall&quot;,
        &quot;price&quot;: &quot;20$&quot;,
        &quot;userId&quot;: &quot;rTEp7K1cE8W4pZF9diB09ZxWfC72&quot;,
        &quot;vinylId&quot;: &quot;v1&quot;
      }
    },
  
  </code></pre>
  <p>Rating table:</p>
  <pre><code>
  &quot;RatingUsersVinyls&quot;: {
      &quot;-N5fUpaXS_kKk_AtIPs1&quot;: {
        &quot;rating&quot;: &quot;4&quot;,
        &quot;userId&quot;: &quot;DiL1JNTc4RO7Eyr2tczv84Q3FII3&quot;,
        &quot;vinylId&quot;: &quot;v1&quot;
      }
    },
  </code></pre>