Skip to content

Commit

Permalink
feat: Allow global context for ListObjects
Browse files Browse the repository at this point in the history
  • Loading branch information
Didier-SimpleCommeDev authored and ewanharris committed Apr 8, 2024
1 parent 9d89e14 commit 7d46fa8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/dev/openfga/sdk/api/client/OpenFgaClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ public CompletableFuture<ClientListObjectsResponse> listObjects(
var bodyContextualTuples = ClientTupleKey.asContextualTupleKeys(contextualTuples);
body.contextualTuples(bodyContextualTuples);
}
if (request.getContext() != null) {
body.context(request.getContext());
}
}

if (options != null && !isNullOrWhitespace(options.getAuthorizationModelId())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class ClientListObjectsRequest {
private String relation;
private String type;
private List<ClientTupleKey> contextualTupleKeys;
private Object context;

public ClientListObjectsRequest user(String user) {
this.user = user;
Expand Down Expand Up @@ -63,4 +64,13 @@ public ClientListObjectsRequest contextualTupleKeys(List<ClientTupleKey> context
public List<ClientTupleKey> getContextualTupleKeys() {
return contextualTupleKeys;
}

public ClientListObjectsRequest context(Object context) {
this.context = context;
return this;
}

public Object getContext() {
return context;
}
}

0 comments on commit 7d46fa8

Please sign in to comment.