Best Generic Way to Check if user has permissions

Currently i do this.

  1. User A sets up to listen to /blogposts
  2. User B makes a POST request to add a blogpost
  3. 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:

  1. User A sets up to listen to /blogposts
  2. User B makes a POST request to add a blogpost
  3. My code Checks if user is allowed to receive get requestes of /blobposts without writing specific code to /blogpost
  4. 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.