Is this the correct way to define a “owner” (a use...
# talk-keto
r
Is this the correct way to define a “owner” (a user) of a group?
Copy code
groups:395ba5f9-f596-4095-aaf1-25d138dfab9c#owner@(users:72f65406-45b1-4b2a-a6f2-af909c10c832)
👀 1
I was wondering whether the JSON parser for this tuple is broken? When I run it through the parser I get the following JSON
Copy code
{
  "namespace": "groups",
  "object": "395ba5f9-f596-4095-aaf1-25d138dfab9c",
  "relation": "owner",
  "subject_id": "users:72f65406-45b1-4b2a-a6f2-af909c10c832"
}
Should
subject_id
be actually a
subject_set
?
I was expecting this to be the output
Copy code
{
  "namespace": "groups",
  "object": "395ba5f9-f596-4095-aaf1-25d138dfab9c",
  "relation": "owner",
  "subject_set": {
    "namespace": "users",
    "object": "72f65406-45b1-4b2a-a6f2-af909c10c832"
  }
}
Sorry to bring more attention to this but was wondering if I could get some help understanding this
m
Maybe @steep-lamp-91158 can answer this 🙏 Thanks for following up Aran, we were quite busy with the conference!
s
a subject set consists of namespace, object, and relation you have to make it
Copy code
groups:395ba5f9-f596-4095-aaf1-25d138dfab9c#owner@(users:72f65406-45b1-4b2a-a6f2-af909c10c832#)
so add the
#
r
What I’m guess I’m trying to understand is this correct that it gets decoded into the first format? I’ve done some testing locally and it seems to work like that but should not be decoded into a subject set?
Also is it best practice to include the
#
or no
#
?
s
r
So I guess internally doesn’t really matter then if I include a
#
or not and shouldn’t affect things performance wise?
s
There is a difference, in one case you store the user id as an object in the user namespace, in the other you use the user id as a subject id Usually you would want to do the latter