Skip to content

Commit b6eb73a

Browse files
authored
Update BWC checks in HasPrivilegesResponse (#35929)
This serialization has been backported to 6.x
1 parent 4a3d66c commit b6eb73a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/HasPrivilegesResponse.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ public int hashCode() {
100100
public void readFrom(StreamInput in) throws IOException {
101101
super.readFrom(in);
102102
completeMatch = in.readBoolean();
103-
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
103+
if (in.getVersion().onOrAfter(Version.V_6_6_0 )) {
104104
cluster = in.readMap(StreamInput::readString, StreamInput::readBoolean);
105105
}
106106
index = readResourcePrivileges(in);
107107
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
108108
application = in.readMap(StreamInput::readString, HasPrivilegesResponse::readResourcePrivileges);
109109
}
110-
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
110+
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
111111
username = in.readString();
112112
}
113113
}
@@ -127,14 +127,14 @@ private static List<ResourcePrivileges> readResourcePrivileges(StreamInput in) t
127127
public void writeTo(StreamOutput out) throws IOException {
128128
super.writeTo(out);
129129
out.writeBoolean(completeMatch);
130-
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
130+
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
131131
out.writeMap(cluster, StreamOutput::writeString, StreamOutput::writeBoolean);
132132
}
133133
writeResourcePrivileges(out, index);
134134
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
135135
out.writeMap(application, StreamOutput::writeString, HasPrivilegesResponse::writeResourcePrivileges);
136136
}
137-
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
137+
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
138138
out.writeString(username);
139139
}
140140
}

0 commit comments

Comments
 (0)