https://www.ory.sh/ logo
#talk-keto
Title
# talk-keto
r

refined-addition-34429

10/28/2021, 11:14 AM
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

magnificent-energy-493

10/29/2021, 7:07 AM
Maybe @steep-lamp-91158 can answer this 🙏 Thanks for following up Aran, we were quite busy with the conference!
s

steep-lamp-91158

10/29/2021, 7:59 AM
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

refined-addition-34429

10/29/2021, 12:00 PM
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

steep-lamp-91158

10/29/2021, 12:02 PM
r

refined-addition-34429

10/29/2021, 12:03 PM
So I guess internally doesn’t really matter then if I include a
#
or not and shouldn’t affect things performance wise?
s

steep-lamp-91158

10/29/2021, 12:05 PM
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
3 Views