简体   繁体   中英

updating user in RMQ with specific role

I want to update the user in rmq with only permission of reading queue with python rabbitmq_admin package . What should I use in the fields of

api.create_user_permission('username', '/', configure='', write='', read='queue')
api.create_user_permission('user', '/', configure='$^', write='$^', read='queue')
api.create_user_permission('user', '/', configure='', write='', read='queue')

I have tried all the above mentioned thing but the user gets all the access, I want the user to have only : read='queue'

I want the permission as follows:

Virtual host    Configure regexp    Write regexp    Read regexp
/                                                          queue

There is the issue with the package it self . i just replaced the part of the package in which it was hard coding the default as '.*'.

Open the package in site package folder (/usr/local/lib/python2.7/site-packages) in you computer and open the api.py file in edit mode. After that just replace the part of create_user_permission function from

data = { 'configure': configure or ' .* ', 'write': write or ' .* ', 'read': read or ' .* ', }

TO

data = { 'configure': configure or '', 'write': write or '', 'read': read or '', }

this will solve the problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM