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
Is your feature request related to a problem? Please describe.
Is there a way to throw "onLiveQueryEvent"? I've restricted LiveQuerying using ACLs, however I'd like to prevent an unauthorised user from even attempting to subscribe to start. I'd also like to be able to force beforeFind logic to LiveQueries, to ensure the LiveQuery queries themselves are efficient and restrictive.
Describe the solution you'd like
Being able to throw from a onLiveQueryEvent, or being able to modify request.query from a LiveQuery.
The text was updated successfully, but these errors were encountered:
Thanks mate. So it would have to be a new trigger? Something like afterLiveQueryEvent, which user can write cloud code - just like onLiveQueryEvent - but if an error is thrown, call Client.pushError? Not entirely familiar with the workings of LiveQuery code but will try create a PR.
Closing as beforeConnect and beforeSubscribe has been merged.
beforeConnect allows validation prior to a LiveQuery opening connection. This is not class specific.
Parse.Cloud.beforeConnect(request => {
if (!request.user) {
throw "Please login before you attempt to connect."
}
});
beforeSubscribe handles the .subscribe methods from LiveQuery. Can be used to validate users, or to mutate the request.query, enforcing fields, equalTo, or whatever required.
Parse.Cloud.beforeSubscribe(Parse.User, request => {
if (!request.user) {
throw "Please login before you attempt to connect."
}
let query = request.query; // the Parse.Query
query.select("name","year")
});
Is your feature request related to a problem? Please describe.
Is there a way to throw "onLiveQueryEvent"? I've restricted LiveQuerying using ACLs, however I'd like to prevent an unauthorised user from even attempting to subscribe to start. I'd also like to be able to force beforeFind logic to LiveQueries, to ensure the LiveQuery queries themselves are efficient and restrictive.
Describe the solution you'd like
Being able to throw from a onLiveQueryEvent, or being able to modify request.query from a LiveQuery.
The text was updated successfully, but these errors were encountered: