Skip to content
Discussion options

You must be logged in to vote

Yes, Hasura requires all session variables referenced in permissions to be present in the request. There is no built-in "if exists" or null-check for session variables themselves in the permission rules.

A couple of workarounds:

1. Always send the variable, even if empty

The cleanest approach is to have your auth webhook always return x-hasura-allowed-features with an empty array [] when the user has no features. I know you mentioned the webhook does not know what variables might be expected, but this is the intended pattern -- the auth layer should be aware of the session variables the permission system requires.

2. Use a default role without feature-based permissions

If some users genui…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by asinbo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants