hey, could you help me with node lib? I
# spicedb
j
hey, could you help me with node lib? I play with this example https://github.com/authzed/authzed-node/blob/main/examples/v1/example.js, I want to get all users who can view
somedocument
. 1. What is the difference between
Copy code
const permissions = await promiseClient.expandPermissionTree(
  {
    resource: {
      objectType: 'test/document',
      objectId: 'somedocument',
    },
    permission: 'view',
  }
)
and analogue with
v1.CheckPermissionRequest.create(...)
,
v1.ObjectReference.create(...)
? Both work and return the same result. 2. Are there other ways to get users other than this
permissions.treeRoot.treeType.intermediate.children[0].treeType.leaf.subjects
?
y
for the answer to your first question, there isn't a difference. the client library will serialize javascript objects using the proto objects, or it can accept the proto objects themselves.
3 Views