Conviley
03/26/2025, 2:10 PMyaml
definition user {}
definition group {
relation member: user
}
definition prompt {
relation creator: user
relation editor: user
relation viewer: user | group#member
permission can_view = creator + editor + viewer
permission can_edit = creator + editor
}
i'm trying to use the node js client to get a list of all the users who has the can_view permission and i am trying to do it like so:
typescript
spicedbClient.lookupSubjects({
resource: {
objectId: promptId,
objectType: 'prompt',
},
permission: 'can_view',
subjectObjectType: 'user',
optionalSubjectRelation: '', // the name suggests its optional but the ts types says otherwise.
wildcardOption: v1.LookupSubjectsRequest_WildcardOption.EXCLUDE_WILDCARDS,
optionalConcreteLimit: 0, // same here and passing anything else than 0 gives me a runtime error saying that the feature is not supported
})
but i don't think this works as i am expecting it to as i get an empty array when i would expect an array with the creator which i set as follows: