Logo-amall
discord (1)
#Usinglistpermissionvariableinpermissions (1)
  • I'm trying to make a permission variable that is using a many-to-many relationship. Something like this: `'{"company-ids":"companies.companyId"}'` When the user has many companies, it looks like this in the token, and I can use the `_in` operator in the permission rule to check `"x-hasura-company-ids": "{\"33333333-3333-3333-3333-333333333333\",\"33333333-3333-3333-3333-333333333333\"}"` However, if the user only has one company it looks like this, and the check breaks `"x-hasura-company-ids": "33333333-3333-3333-3333-333333333333"` And I get this error: `malformed array literal: \"33332a37-f01c-4195-9360-268136725b06\"` I understand that moving the single element out of an array is probably useful more often than not πŸ˜„ but is there a smart way to work around this?

    Last active 4 months ago

    10 replies

    7 views

    MO
    MO
    +8