bkjones / pyrabbit

A Python module to communicate w/ the RabbitMQ HTTP Management API
http://pyrabbit.readthedocs.org
BSD 3-Clause "New" or "Revised" License
97 stars 86 forks source link

Remove the has_admin_rights property #40

Closed julienr closed 8 years ago

julienr commented 9 years ago

This is a proposal to remove the has_admin_rights and replace it with a Client._call method that turns HTTP 401 (unauthorized) into PermissionError.

I think this is a better approach because otherwise has_admin_rights will end up having to exactly replicate the authorization logic of rabbitmq to handle all the corner cases. This seems hard and unnecessary. I think pyrabbit should just provide wrapper around the HTTP API without trying to be too smart.

This fixes problems with vhost-only users, like #39