graphql-engine icon indicating copy to clipboard operation
graphql-engine copied to clipboard

role-based query / mutation allow list

Open hilalh opened this issue 5 years ago • 4 comments

I would love to have role-based query / mutation allow list rather than checking for permissions manually inside each and every model, both the console and the actual server need to modified for that. Any sort of implementation ideas?

hilalh avatar Aug 30 '19 10:08 hilalh

I think it would be great if we had a dropdown section in permissions when you edit a role, similar to column selection, where you can toggle on/off queries/mutations. A real world use case would be where I want to only allow by_pk queries for some users so that they can't get a full list of items and can only get data where they know the id of the resource.

shanecontinued avatar Nov 11 '19 14:11 shanecontinued

I would also be interested in a way to allow only by_pk queries on rows where a ownerId is null, so that the user needs to know the id of the row in order to read it. And then allowing all queries on rows with a ownerId, so that the owner can list all their rows. Is there currently a solution to this? https://firebase.google.com/docs/firestore/security/rules-structure#granular_operations

franciscolourenco avatar Nov 27 '19 16:11 franciscolourenco

@shanetierney and @franciscolourenco - have you seen the "allow root fields" permission feature: https://hasura.io/docs/latest/auth/authorization/permission-rules/#disabling-root-fields, that could help you with the by_pk use-case. We have also released a comprehensive role based allow list manager in V13 - by_pk use-case because we solved

rahulagarwal13 avatar Oct 12 '22 22:10 rahulagarwal13

have you seen the "allow root fields" permission feature Yes it solves some cases but not all

We have also released a comprehensive role based allow list manager in V13

V13? I'm not sure what you are talking about.

franciscolourenco avatar Oct 12 '22 22:10 franciscolourenco

@franciscolourenco - I meant in Hasura V2.13 - https://hasura.io/docs/latest/security/allow-list/#role-based-allow-list

rahulagarwal13 avatar Jan 16 '23 22:01 rahulagarwal13