https://authzed.com logo
Title
j

Jonathan Hope

11/21/2022, 7:47 PM
Is there a way to get all of the resources that a subject has a permission for? I.e. for a schema like this:
definition account {
    relation account_admin: user

    permission read = account_admin
}
Can I get the all of the accounts that a user has read permission for. I've tried this:
const response = await client.lookupResources(
  LookupResourcesRequest.create({
    resourceObjectType: 'account',
    permission: 'read',
    subject: SubjectReference.create({
      object: user,
    }),
  }),
);
But the permissionship comes back as 0. I believe that means that I can't reliably say that the user has read permission for the the accounts that are returned.