diff --git a/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java b/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java index 1204b7e061..6e64ef6997 100644 --- a/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java +++ b/src/main/java/org/opensearch/security/rest/resource/ShareWithRequest.java @@ -34,10 +34,10 @@ public ShareWithRequest(String resourceId, String resourceIndex, ShareWith share this.shareWith = shareWith; } - public ShareWithRequest(StreamInput in, Reader shareWithReader) throws IOException { + public ShareWithRequest(StreamInput in) throws IOException { this.resourceId = in.readString(); this.resourceIndex = in.readString(); - this.shareWith = shareWithReader.read(in); + this.shareWith = new ShareWith(in); } @Override diff --git a/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java b/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java index 014b08d5f0..d2427698a9 100644 --- a/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java +++ b/src/main/java/org/opensearch/security/rest/resource/ShareWithTransportAction.java @@ -30,7 +30,6 @@ import org.opensearch.index.query.QueryBuilders; import org.opensearch.search.SearchHit; import org.opensearch.search.builder.SearchSourceBuilder; -import org.opensearch.security.spi.ShareWith; import org.opensearch.tasks.Task; import org.opensearch.transport.TransportService; @@ -47,7 +46,7 @@ public class ShareWithTransportAction extends HandledTransportAction new ShareWithRequest(in, ShareWith::new)); + super(ShareWithAction.NAME, transportService, actionFilters, ShareWithRequest::new); this.transportService = transportService; this.nodeClient = nodeClient; }