Added check on read access (in publish)

This commit is contained in:
andrea
2015-05-20 21:53:13 +02:00
parent 75e67dcbd0
commit 1aecc3d922
@@ -299,6 +299,8 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
//check if the topic can be wrote
if (m_authorizator.canWrite(topic)) {
processPublish(clientID, topic, qos, message, retain, msg.getMessageID());
} else {
LOG.debug("topic {} doesn't have write credentials", topic);
}
}
@@ -371,6 +373,10 @@ class ProtocolProcessor implements EventHandler<ValueEvent> {
if (qos.ordinal() > sub.getRequestedQos().ordinal()) {
qos = sub.getRequestedQos();
}
if (!m_authorizator.canRead(topic)) {
LOG.debug("topic {} doesn't have read credentials", topic);
continue;
}
LOG.debug("Broker republishing to client <{}> topic <{}> qos <{}>, active {}",
sub.getClientId(), sub.getTopicFilter(), qos, sub.isActive());