From b6eb73a835a94d55f66646c082d0c9ec81a28944 Mon Sep 17 00:00:00 2001 From: Tim Vernum Date: Tue, 27 Nov 2018 21:05:12 +1100 Subject: [PATCH] Update BWC checks in HasPrivilegesResponse (#35929) This serialization has been backported to 6.x --- .../core/security/action/user/HasPrivilegesResponse.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java index 0942ef053a8..f330789d834 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java @@ -100,14 +100,14 @@ public class HasPrivilegesResponse extends ActionResponse implements ToXContentO public void readFrom(StreamInput in) throws IOException { super.readFrom(in); completeMatch = in.readBoolean(); - if (in.getVersion().onOrAfter(Version.V_7_0_0)) { + if (in.getVersion().onOrAfter(Version.V_6_6_0 )) { cluster = in.readMap(StreamInput::readString, StreamInput::readBoolean); } index = readResourcePrivileges(in); if (in.getVersion().onOrAfter(Version.V_6_4_0)) { application = in.readMap(StreamInput::readString, HasPrivilegesResponse::readResourcePrivileges); } - if (in.getVersion().onOrAfter(Version.V_7_0_0)) { + if (in.getVersion().onOrAfter(Version.V_6_6_0)) { username = in.readString(); } } @@ -127,14 +127,14 @@ public class HasPrivilegesResponse extends ActionResponse implements ToXContentO public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeBoolean(completeMatch); - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { + if (out.getVersion().onOrAfter(Version.V_6_6_0)) { out.writeMap(cluster, StreamOutput::writeString, StreamOutput::writeBoolean); } writeResourcePrivileges(out, index); if (out.getVersion().onOrAfter(Version.V_6_4_0)) { out.writeMap(application, StreamOutput::writeString, HasPrivilegesResponse::writeResourcePrivileges); } - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { + if (out.getVersion().onOrAfter(Version.V_6_6_0)) { out.writeString(username); } }