openfga / language

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

Playground authorization model fails #120

Closed joseph-salem closed 10 months ago

joseph-salem commented 10 months ago

Summary

I used docker compose to spin a container for openfga. In the playground, I copied the example found at https://openfga.dev/docs/modeling/user-groups.

The playground give me this error :

image

By debugging, at discovered that the real error is:

TypeError: Cannot read properties of undefined (reading 'member')
    at b (_app-3f8777cf4f50374e.js:1:559716)
    at _app-3f8777cf4f50374e.js:1:566200
    at Array.forEach (<anonymous>)
    at _app-3f8777cf4f50374e.js:1:566115
    at O (_app-3f8777cf4f50374e.js:1:566418)
    at t.validateDSL (_app-3f8777cf4f50374e.js:1:566784)
    at t.validateDSL (_app-3f8777cf4f50374e.js:1:407940)
    at onChange (_app-3f8777cf4f50374e.js:1:867140)
    at 727.3d4089e0c45544c8.js:1:3895891
    at e.value (727.3d4089e0c45544c8.js:1:943659)

Did I do something wrong when I paste the Authorization Model copied from you documentation ?

Store data

model_file: |
model
  schema 1.1
type user
type document
  relations
    define editor: [team#member]
type team
  relations
    define member: [user]

Other data

Docker compose file : https://openfga.dev/docker-compose.yaml

rhamzeh commented 10 months ago

Thanks for reporting the issue @joseph-salem - we're looking into it

rhamzeh commented 10 months ago

Thanks for reporting @joseph-salem - we just released new versions of the language, vs code and playground with the fix