Hi, <div><br></div><div>Wouldn't it be enough to have only write permission to write to exchange, provided I do passive mode, </div><div><br></div><div>Here is example ruby script I expected to work but it doesn't.</div>
<div><br></div><div>prep with </div><div>gem install bunny</div><div>gem install rspec</div><div><br></div><div>run with</div><div><br></div><div>rspec test.rb</div><div><br></div><div><br></div><div>test.rb:</div><div>--------------------------------------------------------------</div>
<div><div>require 'bunny'</div><div>system "sudo rabbitmqctl add_vhost /x"</div><div>system "sudo rabbitmqctl add_user writer 123"</div><div># with this it works</div><div># system "sudo rabbitmqctl set_permissions -p /x writer '.*' '.*' 'foo'"</div>
<div># with this it doesn't</div><div>system "sudo rabbitmqctl set_permissions -p /x writer 'foo' '.*' 'foo'"</div><div>system "sudo rabbitmqctl add_user admin 321"</div><div>
system "sudo rabbitmqctl set_permissions -p /x admin '.*' '.*' '.*'"</div><div><br></div><div>describe "wonderful bunny permission tests" do</div><div> it "should only push" do</div>
<div><br></div><div><br></div><div> @admin = Bunny.new(:host => 'localhost',:vhost=> "/x", :port => 5672,:user=>"admin",:pass=> "321" )</div><div> @admin.start</div>
<div><br></div><div> # create/get queue</div><div> q = @admin.queue('myqueue')</div><div><br></div><div> # create/get exchange</div><div> exchange = @admin.exchange("myexchange",:type => :topic,:durable => true)</div>
<div><br></div><div> # bind queue to exchange</div><div> q.bind(exchange,:key => "#")</div><div><br></div><div> ##############################</div><div> @writer = Bunny.new(:host => 'localhost',:vhost=> "/x", :port => 5672,:user=>"writer",:pass=> "123",:logging=>true )</div>
<div> @writer.start</div><div> e = @writer.exchange("myexchange", :passive => true)</div><div> e.publish "yo"</div><div><br></div><div> q.pop[:payload].should == "yo"</div><div>
end</div><div><br></div><div>end</div></div><div><br></div><div>And reply is:</div><div><div>I, [2012-02-13 14:50:54#16707] INFO -- send: #<Qrack::Transport::Method:0x7fd6f3cee0d8 @payload=#<Qrack::Protocol::Exchange::Declare:0x7fd6f3cee5d8 @auto_delete=nil, @durable=nil, @passive=true, @nowait=nil, @type=:direct, @exchange="myexchange", @arguments=nil, @internal=nil, @ticket=1>, @channel=1></div>
<div>I, [2012-02-13 14:50:54#16707] INFO -- received: #<Qrack::Transport::Method:0x7fd6f3ceb540 @payload=#<Qrack::Protocol::Channel::Close:0x7fd6f3ceb400 @method_id=10, @class_id=40, @reply_text="ACCESS_REFUSED - access to exchange 'myexchange' in vhost '/x' refused for user 'writer'", @reply_code=403>, @channel=1></div>
<div><br></div></div><div><br></div><div>Why do I still need config permission, although I opened exchange with passive option.</div><div><br></div><div>Rubycut</div><div><br></div><div><br></div><div><br></div>