Field Level Filtering #6275
Unanswered
andrewalex
asked this question in
Question
Replies: 1 comment 1 reply
-
@andrewalex - Since you would like to hide certain fields based on different situations, you should ideally be using the role-based permission system to handle this. Have you considered restrictions based on roles? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently when I need to hide certain fields in a table I use a view. (Ex. table persons view persons_notaxid). This is workable, but a little hairy (such as the person needs to query a different table when they need a ssn, implications of caching issues etc).
However. This can get quickly out of hand when there are multiple fields that need to be filtered in different situations and changes per record (taxid, home address, phone number, last name)
I tried using functions for this, however its also very clunky because they dont exist within hasura relationships, so they work ok for the top node (get_persons()->notes) but not as a sublevel (notes->get_persons())
Ideally this seems easiest to handle with some postprocessing of the data. Right now the only solution I see is pivoting the table in the view so its in the format (id, fieldname, fieldvalue) and I can run permissions on WHERE fieldname = 'taxid'.. this seems extremely messy.
Is there a better way to do this?
Beta Was this translation helpful? Give feedback.
All reactions