Describe the bug
If a rule is defined in a schema, the parameter(s) of that rule has to be the same name as the attribute(s) you are trying to validate with the rule. This prevents writing "helper" rules like a global negator rule.
To Reproduce
entity user {}
entity resource {
relation owner @user
attribute is_private boolean
permission view = negate(is_private)
}
rule negate(input boolean){
!input
}
Expected behavior
Schema is valid.
Actual
8:31: invalid argument
Additional context
This problem was mentioned in 2025.02.28 on Discord but I couldn't find a bug ticket for it.
Environment (please complete the following information, because it helps us investigate better):
Describe the bug
If a rule is defined in a schema, the parameter(s) of that rule has to be the same name as the attribute(s) you are trying to validate with the rule. This prevents writing "helper" rules like a global negator rule.
To Reproduce
Expected behavior
Schema is valid.
Actual
8:31: invalid argument
Additional context
This problem was mentioned in 2025.02.28 on Discord but I couldn't find a bug ticket for it.
Environment (please complete the following information, because it helps us investigate better):