You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.
I'm coming up against a minor (and perhaps fixable in future) problem. Let's say I have a firebase reference at some.firebase.io/options. My rules say that everybody can read this reference, but only admin users can write to it, something like this:
For "admin" users there's no problem, but for other users who can't write to the reference there's a Firebase warning when page first loads:
FIREBASE WARNING: update at /options failed: permission_denied
I understand that this is as it should be -- that Firebase is obeying my rules. I also understand that the warning is not a huge problem, but I hate warnings, so...
What (I think) happens now, and results in the warning, is that backbonefire automatically tries to create a model on the server. Might there possibly be a way to say that you just want to fetch an existing model from the server? Something like this:
var MyModel = Backbone.Firebase.Model.extend({
url: myReference,
readFirst: true
})
In other words autoSync would still be enabled, but if readFirst is true, then the model is initially populated from the server. My app can allow a user to modify the model afterwards, and those changes would be synced. The initial behavior of collections could be modified in the same way.
Sorry for the lengthy post about a minor problem. Let me know what you think,
-- Chris
The text was updated successfully, but these errors were encountered:
We actually were discussing something like a readFirst type functionality the other day. I've been toying with the idea of providing control over specific syncing events. This would cover your typical Firebase events (value, child_added, child_removed) as well as the initial sync, which is what you're looking for.
This way you would be able to do any custom operations like joining the result of two references or canceling a connection when a user is not properly authenticated.
I don't have an API to reference here, but I'll see if I can come up with some ideas in the next couple of days.
Thanks for the great library.
I'm coming up against a minor (and perhaps fixable in future) problem. Let's say I have a firebase reference at
some.firebase.io/options
. My rules say that everybody can read this reference, but only admin users can write to it, something like this:For "admin" users there's no problem, but for other users who can't write to the reference there's a Firebase warning when page first loads:
I understand that this is as it should be -- that Firebase is obeying my rules. I also understand that the warning is not a huge problem, but I hate warnings, so...
What (I think) happens now, and results in the warning, is that backbonefire automatically tries to create a model on the server. Might there possibly be a way to say that you just want to fetch an existing model from the server? Something like this:
In other words autoSync would still be enabled, but if
readFirst
is true, then the model is initially populated from the server. My app can allow a user to modify the model afterwards, and those changes would be synced. The initial behavior of collections could be modified in the same way.Sorry for the lengthy post about a minor problem. Let me know what you think,
-- Chris
The text was updated successfully, but these errors were encountered: