Kamalakannan J
Kamalakannan J

Reputation: 2998

Crossbar.io - Restrict user to subscribe to only two topics

I had seen in the Crossbar.io documentation, that we can set role to publish only to specific topic. But how can I set a role to publish exactly matching two topics rather than pattern based matching.

Upvotes: 0

Views: 270

Answers (1)

oberstet
oberstet

Reputation: 22051

You can use a configuration like this (see Static Authorization in the docs):

"realms": [
   {
      "name": "realm1",
      "roles": [
         {
            "name": "role1",
            "permissions": [
               {
                  "uri": "com.example.topic1",
                  "publish": true
               },
               {
                  "uri": "com.example.topic2",
                  "publish": true
               }
            ]
         }
      ]
   }
]

Upvotes: 1

Related Questions