What is the best practice to write the rules of Firebase in a situation like this?
问题 Initial approach/problem The user will be able to write to his own user node. Then the user has to be able to write as many buildings he/she wants and as many depts as he/she wants (there are also rooms but I will leave that aside for now for clarity's sake). The user should be able to read (and write) his own user node, buildings and departments but not the other users' node, buildings and departments. Basically: User > user's Building > building's Department (TOTAL read and write