summaryrefslogtreecommitdiff
path: root/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java')
-rw-r--r--java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java b/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
index 46182e8c00..57ce7a7240 100644
--- a/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
+++ b/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
@@ -108,7 +108,16 @@ public class QueueBindHandler implements StateAwareMethodListener<QueueBindBody>
{
//Perform ACLs
- virtualHost.getAccessManager().authorise(session, Permission.BIND, body, exch, queue, routingKey);
+ if (!virtualHost.getAccessManager().authoriseBind(session, exch,
+ queue, routingKey))
+ {
+ throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, "Permission denied");
+ }
+ else if (queue.isExclusive() && !queue.isDurable() && queue.getExclusiveOwner() != session)
+ {
+ throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
+ "Queue " + queue.getName() + " is exclusive, but not created on this Connection.");
+ }
if (!exch.isBound(routingKey, body.getArguments(), queue))
{