Currently i do this.
- User A sets up to listen to /blogposts
- User B makes a POST request to add a blogpost
- User A will get a notification about the blogpost.
This code is generic and will be run for every POST request and will send messages to the respective listeners via socket.io
What I want to know if there is a Generneric way to check if a user is allowed to even receive this get request.
Like this:
- User A sets up to listen to /blogposts
- User B makes a POST request to add a blogpost
- My code Checks if user is allowed to receive get requestes of /blobposts without writing specific code to /blogpost
- User A will get a notification about the blogpost ONLY if he has premission to make a get request anyways.
PS: Thanks for the quick reply already. I really appriciate that.