@Override
    public boolean hasInfo(String name, String node, JID senderJID) {
        if (NAMESPACE.equals(node)) {
            return true;
        }
        else {
            // Only include commands that the sender can execute
            AdHocCommand command = manager.getCommand(node);
            return command != null && command.hasPermission(senderJID);
        }
    }
Manager that keeps the list of ad-hoc commands and processing command requests.
xmppserver/src/main/java/org/jivesoftware/openfire/commands/AdHocCommandHandler.java