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
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