Best Generic Way to Check if user has permissions

I’m currently reengineered my the listner middleware that I am writing to be able to call strapi.realtime.addListener(socket, path) which allowes me to emit packets to the clients socket the second there is an update is a sucessfull POST request for an item.

Now the question would be:
Is there a possibility to automaticaly generate an endpoint /blogpost/add-listener that calls that function only if blogposts is allowed to do a GET request for /blogpost.

Here is the middleware btw GitHub - Renji3/strapi-middleware-realtime (still needs a bit refactoring)