Skip to content

[BUG] Rule's parameters must be the same name as the attributes you check against #2749

@mezakos

Description

@mezakos

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):

  • Docker
  • Version 1.6.2

Metadata

Metadata

Labels

bugSometing isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions