Click here to Skip to main content
16,019,614 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to allow only two users to access firebase database to perform read and write operations?I have tried to do so but I am able to add only 1 user
Whenever I try to add 2 users it shows error.

What I have tried:

{

  "rules": 

        {
        ".write":"auth.uid ==='yoz4SkfUu3gv1QZt8dVFsF4jj9J2','yoz4SkfUu3gv1QZt8dVFsF4jj9J2'"
        ".read":"auth.uid ==='yoz4SkfUu3gv1QZt8dVFsF4jj9J2'"     }

}

It shows this error.It works fine if i add only 1 user id.
Quote:
Error saving rules - Line 6: Rule expressions may not contain ',' operator.
Posted
Comments
David Crow 12-Apr-18 9:10am    
If you had each user listed in the /users node, could you do something like:
"$user":
{ 
  ".read": "auth.uid === $user" 
  ".write": "auth.uid === $user" 
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900