hasura / hasura/graphql-engine

Support for arrays containing integers for permissions

Open
#8,027 0 comments 7 reactions 0 assignees View on GitHub
k/enhancement
Dominant language
TypeScript
Stars
32.1k
Forks
3k
PR merge metrics
PR metrics pending

Description

### Is your proposal related to a problem?
The user permissions do not support _contains and other operators. We have a use case where we store permissions to group. Anyone associated with the group has the ability to access that row.

### Describe the solution you'd like
We would like the two solutions
1. _contains to support int4[] arrays.
2. Permissions to support _contains operator.
```json
{
"group_ids": {
"_contains": "X-Hasura-group-Id"
}
}
```

### Describe alternatives you've considered
No alternatives, It would require many changes in the database. We will have to drop hasura, it it cannot support _contains for int4[].

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported permission query with a PostgreSQL int4[] column and the _contains operator. Trace how array operators and permission filters are handled, then add coverage showing both int4[] containment and the requested group_ids permission expression work correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, postgres
Domain
api, authorization, database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.