While trying to model some nested relation, I noticed that accessing any parent level except the one just above the current level gives me an error. For example
model
schema 1.1
type user
type system
relations
define admin: [user]
define staff: [user] or admin
type organization
relations
define system: [system]
type resource
relations
define system : system from organization
define organization: [organization]
define can_delete: staff from system
The error being
`can_delete` is an impossible relation for `resource` (no entrypoint)
The error message is incorrect, it should be:
`system` relation used inside from allows only direct relation.
The referenced base relation used after the from system in staff from system MUST be a directly assignable relation that has no rewrites and does not allow direct assignment of <type>:* and <type>#<relation>, so it MUST be of the form:
define system: [<type>, <type2>, etc..]
And this validation should take precedence over no entry point (also in this case, there is an entry point)
Discussed in https://github.com/orgs/openfga/discussions/297
Originally posted by Chedi April 14, 2024
While trying to model some nested relation, I noticed that accessing any parent level except the one just above the current level gives me an error. For example
The error being
The error message is incorrect, it should be:
The referenced base relation used after the from
system
instaff from system
MUST be a directly assignable relation that has no rewrites and does not allow direct assignment of<type>:*
and<type>#<relation>
, so it MUST be of the form:And this validation should take precedence over no entry point (also in this case, there is an entry point)