With CometD, you can fine tune the behaviour you want.
You have available a SecurityPolicy
that allow you to control coarsely the publish authorizations, and channel Authorizers
that allow you to control finely the publish authorizations (among others).
Have a read at the SecurityPolicy
documentation, and at the Authorizers
documentation.
The Bayeux protocol has been designed by the CometD project where you can find the latest specification.
Have also a look at the CometD tutorials, if you want to get started with CometD.