'How to give access to the specific path of my Firebase server to some users?

I am new with front end and Vue in particular.

To learn I am building now very simple budget app for my daughter. There are 2 input fields: one for income, another is for expenses. My daughter will have the right to add expenses, but not income. She also can add expenses, edit them and delete them. I as an admit can also work with expenses as well as with income (for my daughter income area will be restricted).

enter image description here

I am using now Firebase as my server.

There is only only 2 paths in my server: income and expenses.

I already managed how to submit all data to the server, but my problem is that I don't know how to manage these rules in the Firebase that my daughter only grants permit to the expenses path of the server.

These are my rules now in the Firebase:

{

"rules": {

"expenses-data": {
  ".read": "auth != null",
    ".write": "auth != null"
},
  "income-data": {
    ".write": "auth != null",
      ".read": "auth != null"
  }

} }

With these rules all authorized users can submit data.

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source