i am try to build blog app using firebase database , l want to allowed to users can they read data post by each others , but unsuccessfully when i used this rules for database
{
"rules": {
"report": {
"$uid": {
".read": "true",
".write": "$uid === auth.uid"
}
}
}
}
When l use this rules the users does not read posts for other user ! , only he can read has own post .
main code
ionViewWillLoad(){
this.fire.authState.subscribe(data => {
if(data && data.email && data.uid){
this.toastCtrl.create({
message : ` welcome ${data.email}`,
duration:2000
}).present()
this.itemsRef = this.db.list(`report/${data.uid}`);
// Use snapshotChanges().map() to store the key
this.items = this.itemsRef.snapshotChanges().pipe(
map(changes =>
changes.map(c => ({ key: c.payload.key, ...c.payload.val() }))
)
);
}
})
}
how can l retrieve the data for every user