diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2014-07-21 10:49:50 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2014-07-21 10:49:50 +0000 |
commit | 1e9c205d1b5b2acfec619844ba3cf50164bc3d79 (patch) | |
tree | b47478c8530504bde321b531ba725d9b8d2ceccd /java/broker-core/src | |
parent | 2bf9fcba59a576861dae424ee5ddfe8fae0a1af9 (diff) | |
download | qpid-python-1e9c205d1b5b2acfec619844ba3cf50164bc3d79.tar.gz |
QPID-4520 : The deletion of autodelete queue due to autodeletion should not require ACL rights for deleting the queue
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1612237 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/broker-core/src')
-rw-r--r-- | java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java b/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java index cb3b5effd0..f2ac1a7cdc 100644 --- a/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java +++ b/java/broker-core/src/main/java/org/apache/qpid/server/queue/AbstractQueue.java @@ -430,7 +430,16 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>> @Override public void performAction(final Deletable object) { - getVirtualHost().removeQueue(AbstractQueue.this); + Subject.doAs(SecurityManager.getSubjectWithAddedSystemRights(), + new PrivilegedAction<Void>() + { + @Override + public Void run() + { + getVirtualHost().removeQueue(AbstractQueue.this); + return null; + } + }); } }; @@ -742,7 +751,16 @@ public abstract class AbstractQueue<X extends AbstractQueue<X>> _logger.info("Auto-deleting queue:" + this); } - getVirtualHost().removeQueue(this); + Subject.doAs(SecurityManager.getSubjectWithAddedSystemRights(), new PrivilegedAction<Object>() + { + @Override + public Object run() + { + getVirtualHost().removeQueue(AbstractQueue.this); + return null; + } + }); + // we need to manually fire the event to the removed consumer (which was the last one left for this // queue. This is because the delete method uses the consumer set which has just been cleared |