What's wrong? ```class LegalEntity implements Nam...
# talk-keto
w
What's wrong?
Copy code
class LegalEntity implements Namespace {
  related: {
    readers: User[]
    writers: User[]
  }

  permits = {
    read: (ctx: Context): boolean =>
      this.related.readers.includes(ctx.subject) ||
      this.related.writers.includes(ctx.subject),
    write: (ctx: Context): boolean => this.related.writers.includes(ctx.subject),
  }
}
relationships.js:
Copy code
[
  {
    "namespace": "LegalEntity",
    "object": "entity1",
    "relation": "readers",
    "subject": "User:user1"
  },
  {
    "namespace": "LegalEntity",
    "object": "entity1",
    "relation": "writers",
    "subject": "User:user2"
  }
]
And getting invalid memory address.
s
please upgrade Keto, that was fixed already
w
I use Ory Network with Ory CLI. No on-premis.
s
ah sorry, I did not see that it is the ory cli
is that up-to-date?
w
Yeh,
Version:  v0.2.2
Actually I fixed that issue. It seems i used wrong format:
"subject": "User:user2"
s
the json payload should be
Copy code
[
  {
    "namespace": "LegalEntity",
    "object": "entity1",
    "relation": "readers",
    "subject_set_namespace": "User",
    "subject_set_object": "user1"
  },
  {
    "namespace": "LegalEntity",
    "object": "entity1",
    "relation": "writers",
    "subject_set_namespace": "User",
    "subject_set_object": "user2"
  }
]
yeah sorry for the confusing api
we are working on improving that
w
@steep-lamp-91158 very quick question - What's recommended way to store relationships? Our own database / or does Ory Network support that option to store relationships in the cloud?
s
there is the create API to store and the patch API to update relationships
you actually have to store them in the cloud
w
Thanks Patrik