hasura / hasura/graphql-engine

Compare session variables to hardcoded values in permissions

Open
#10,273 1 comment 2 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

I have in my system multiple different groups that users can be related to, these are stored in session variables. Different database tables often are relevant to a certain set of groups.
Currently, session variables can only be compared to data in the table in the permissions section. It would help us a long way if there were a way to compare them to a hardcoded value.
For instance if you could define the row level security of a table as follows
{
"x-hasura-group-id": {
"_eq": "groupA"
}
}
or as
{
"x-hasura-group-id": {
"_in": ["groupA","groupC"]
}
}

Thanks for the help

Contributor guide

Open the contributing guide

Research direction

The issue names no implementation files, tests, or entry points. Start by tracing Hasura permission handling for session-variable comparisons and compare the requested _eq and _in constant forms with current expression behavior; done means both examples are supported and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql
Domain
api, authorization, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.