I know that it is a common question but I did not find my question along the previous ones.
I have created a new firebase project and I am trying to work with it. I have created public so everybody can actually work with:
Permissions
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read, write;
}
}
}
But when I have tried to post one object I have gotten an error:
Error: Uncaught (in promise): Error: PERMISSION_DENIED: Permission denied Error: PERMISSION_DENIED: Permission denied
How could not I have permissions if the database is currently public? How could I solve it?
My code is pretty simple:
Object
export class Coordenate {
$key: string;
latitude: number;
longitude: number;
}
Typescript component
onAddMarker(event) {
this.databaseService.postCoordenate(event.coords.lat, event.coords.lng);
//this.latitude = event.coords.lat;
//this.longitude = event.coords.lng;
}
Service
listToStore: AngularFireList<any>;
//Insert a new bet
postCoordenate(latitude, longitude) {
this.listToStore = this.db.list("coordenates");
//Get the value of the photo URL in subscribe
this.listToStore.push({
latitude: latitude,
longitude: longitude
});
}
The firebaseConfig
is add to my environment
in my angular project