You can validate that the user has correct permissions by trying to access entities with the user’s access token.
First, try to access /routes
, which this user doesn’t have permissions for:
curl "http://localhost:8001/routes" \
-H "Kong-Admin-Token:alex-token"
If RBAC was enabled correctly, this request returns the following error message:
{"message":"alex, you do not have permissions to read this resource"}%
Now, try adding a Service using the /services
endpoint:
curl -X POST "http://localhost:8001/services" \
-H "Kong-Admin-Token:alex-token" \
--json '{
"name": "test-service",
"host": "httpbin.konghq.com"
}'
This time, the request succeeds with a 200
and creates a new Service.