Security rule - how to set rule so that anybody can read data even without login but write after login.

已查看 15 次
跳至第一个未读帖子

Digvijay Singh Thakur

未读,
2016年4月27日 15:43:332016/4/27
收件人 Firebase Google Group
Hello , i am making app android app for book discovery platform where users are able to see listed books on app even without login but if somebody wants to add books then they need to login first and then it will be added and shown to all.

                        Node where i am storing books are:

                   Firebase ref = new Firebase("https://bookcomet.firebaseio.com/books");

      
                          and my security rules are as follows:

{
    "rules": {
          ".read":true,
       "books":{
             ".write":"auth != null"
           
          }
    }
}

    Problem is when i am fetching data then my whole listview gets populated with the new data added by the logged in user everytime.It is unable to fetch all the data available in my         database .

                  what wrong i am doing here.                                               
                                                                       
回复全部
回复作者
转发
0 个新帖子