API to discover/reflect relation names from a resource type (reflection)
conside the simple schema below
definition application {
}
definition product {
relation application: application
relation owner: user
}
when user "A" in application "app1" create a product "B" , I will write these two tuples into to spicedb (product:B#application@application:app1) and (product:B#owner@user:A) ,where can I get the relation name "application" and "owner"。
I tried the ReadRelationships method in spicedb,but it will give me all relationships.
Currently, there is no dedicated API for listing the possible relations for a given Object Type.
We currently recommend maintaining these relation names in your application's code, similar to how you'd define the names of table columns when using an ORM for a relational database.
It would be very helpful if there is API that allow to query Authorization Model.
- Return all definition "types"
- Return definition "types" for a given namespace.
- Return all the relationship for a given Object Type.
- Return all the permission for a given Object Type.
Few more requests:
- Provided two types - provide all the relations possible between them. type project{ relation admin: user } [project,user]-> [admin]
- Provided one type & relation - provide all the types that can be related provided type with the mentioned relationship. type project{ relation admin: user } [project,admin ] -> [user]
- Provided source, target types, and relation - provide all the relation/permission of target type that can be associated here
type project{
relation admin: group#all_member
} [source : project, target : group , relation : admin ] ---> [all_member]