-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reject LiveQuery events / modify LiveQuery query in Cloud Code #6642
Comments
I like this feature and it should be easy to add a trigger for this. How do you foresee the code looking for this? You can look here for subscription handling. |
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.
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.
And via the JS-SDK:
|
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: