Skip to content

Commit 8905252

Browse files
committed
fix: correct list_users usage in example
1 parent 5cfd9c1 commit 8905252

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

example/example1/example1.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
TypeDefinition,
1717
Userset,
1818
Usersets,
19+
UserTypeFilter,
1920
WriteAuthorizationModelRequest,
2021
)
2122
from openfga_sdk.client.models import (
@@ -306,16 +307,17 @@ async def main():
306307
# ListUsers
307308
print("Listing user who have access to object")
308309

309-
response = await fga_client.list_objects(
310+
response = await fga_client.list_users(
310311
ClientListUsersRequest(
311312
relation="viewer",
312313
object=FgaObject(type="document", id="roadmap"),
313314
user_filters=[
314-
FgaObject(type="user"),
315+
UserTypeFilter(type="user"),
315316
],
317+
context=dict(ViewCount=100),
316318
)
317319
)
318-
print(f"Users: {response.objects}")
320+
print(f"Users: {response.users}")
319321

320322
# WriteAssertions
321323
await fga_client.write_assertions(

0 commit comments

Comments
 (0)