Joey
10/21/2022, 6:19 PMJoey
10/21/2022, 6:19 PMPrchowdh
10/21/2022, 6:23 PMJoey
10/21/2022, 6:24 PMJoey
10/21/2022, 6:24 PMPrchowdh
10/21/2022, 6:26 PMJoey
10/21/2022, 6:27 PMSyebaurgh
10/21/2022, 6:27 PMdefinition location {
relation administrator: user | role#member
relation devices_viewer: user | role#member
permission admin = administrator
permission view_devices = devices_viewer + admin
}
definition role {
relation member: user | role#member
}
so for example, the user has the administrator
relation with a location and wants to create a role with the view_devices
permission through the devices_viewer
relation, but since they don't have the devices_viewer
relationship but have the view_devices
permission, how do we check that the user can grant the role the view_devices
permission through the devices_viewer
relation which would ultimately grant the role the view_devices
permission?Joey
10/21/2022, 6:28 PMSyebaurgh
10/21/2022, 6:30 PMJoey
10/21/2022, 6:33 PMdevices_viewer
role, write a relationship to that relationSyebaurgh
10/21/2022, 6:38 PMview_devices
and we know that user only has the administrator
relation not the devices_viewer
relation.
Would I have to make note in my application the specific relation that corresponds to the permission that can be granted and then I can check if the user has that permission before creating the relation with the role? Would that be the encoding in my application?Joey
10/21/2022, 6:38 PMJoey
10/21/2022, 6:39 PMGMG-Christine
10/21/2022, 6:41 PMSyebaurgh
10/21/2022, 6:41 PMJoey
10/21/2022, 6:42 PMSyebaurgh
10/21/2022, 9:23 PMorganization
and can create roles for it and assign any permission on any resource in the organization, with a direct or indirect relationship with the org, to the role, would that require updating the ZedToken on the organization every time any relationship is updated/written so the role can have the most up to date permissions when checking?
In that case is that pretty much just having one zedToken and using it everywhere?Joey
10/21/2022, 9:28 PMSyebaurgh
10/21/2022, 11:34 PMspicedb serve
Joey
10/22/2022, 3:03 AMSyebaurgh
10/22/2022, 3:41 AMSanPeterDev
10/23/2022, 10:43 AMJoey
10/23/2022, 5:04 PMdefinition user {}
definition region {
relation sales_manager: user
relation sales_clerk: user
relation accountant: user
...
permission edit_order = sales_manager + accountant
}
definition order {
relation location: region
permission edit = location->edit_order
}
Syebaurgh
10/24/2022, 12:48 AMReadSchema
returns the schema as a string, is there no way to get a parsed version of the schema, where we can easily get the definitions or permissions defined in a definiton, or do we have to parse the schema ourselves?Joey
10/24/2022, 12:50 AMSyebaurgh
10/24/2022, 12:52 AMJoey
10/24/2022, 12:52 AMSyebaurgh
10/24/2022, 12:53 AMpj
10/24/2022, 10:10 AM