Commit 3c896134 authored by Dmitry Deshevoy's avatar Dmitry Deshevoy Committed by Guus der Kinderen

Check if sender is a component first in PubSubEngine::createNodeHelper

parent 3e4b1430
......@@ -1151,7 +1151,7 @@ public class PubSubEngine {
// Get sender of the IQ packet
JID from = iq.getFrom();
// Verify that sender has permissions to create nodes
if (!service.canCreateNode(from) || (!UserManager.getInstance().isRegisteredUser(from) && !isComponent(from)) ) {
if (!service.canCreateNode(from) || (!isComponent(from) && !UserManager.getInstance().isRegisteredUser(from))) {
// The user is not allowed to create nodes so return an error
return new CreateNodeResponse(PacketError.Condition.forbidden, null, null);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment