openfga / language

Grammar for the OpenFGA modeling language
https://openfga.dev
Apache License 2.0
16 stars 7 forks source link

Support nested userset rewrite operands in the DSL in the Go bindings #132

Closed rhamzeh closed 7 months ago

rhamzeh commented 7 months ago

Related to #16

Currently the Go bindings do not properly support mixed operators. Work has happened in #107 to add the bindings to JS

The following will result in incorrect JSON

Tests for these cases are already in place and the Go implementation fails on them

 define relation: (rel1 and rel2) but not rel3
 define relation: ((rel1 and rel2) but not rel3) # transformation back to DSL will not keep the extraneous surrounding brackets
 define relation: rel1 and (rel2 but not rel3)
 define relation: rel1 and ((rel2 but not rel3) or (rel4 and (rel5 but not rel6 from rel7)))
 define relation: [user, user:*, user#follower with condition] or ((rel1 and rel2) but not rel3)
 define relation: ([user] or ((rel1 and rel2)) but not rel3