diff --git a/broker/src/main/java/io/moquette/spi/impl/ProtocolProcessor.java b/broker/src/main/java/io/moquette/spi/impl/ProtocolProcessor.java index 71a43bc5..b02522a3 100644 --- a/broker/src/main/java/io/moquette/spi/impl/ProtocolProcessor.java +++ b/broker/src/main/java/io/moquette/spi/impl/ProtocolProcessor.java @@ -474,16 +474,6 @@ public class ProtocolProcessor { m_interceptor.notifyTopicPublished(msg, clientID, username); } - private boolean checkWriteOnTopic(String topic, Channel channel) { - String clientID = NettyUtils.clientID(channel); - String username = NettyUtils.userName(channel); - if (!m_authorizator.canWrite(topic, username, clientID)) { - LOG.debug("topic {} doesn't have write credentials", topic); - return true; - } - return false; - } - private void receivedPublishQos1(Channel channel, PublishMessage msg) { //verify if topic can be write final String topic = msg.getTopicName(); @@ -552,6 +542,16 @@ public class ProtocolProcessor { m_interceptor.notifyTopicPublished(msg, clientID, username); } + private boolean checkWriteOnTopic(String topic, Channel channel) { + String clientID = NettyUtils.clientID(channel); + String username = NettyUtils.userName(channel); + if (!m_authorizator.canWrite(topic, username, clientID)) { + LOG.debug("topic {} doesn't have write credentials", topic); + return true; + } + return false; + } + /** * Intended usage is only for embedded versions of the broker, where the hosting application want to use the * broker to send a publish message.