Ability to pre-filter items shown in lists (overviews) #6352
Replies: 1 comment 1 reply
-
what you want is exactly the access control for read and not something else, unless you implement at graphql layer it will be possible to circumvent it using api. Also it may be needed for your app so that people can query and see other user profile in that case you can not restrict it using the pre canned query filter |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Maybe I'm overlooking this, but I have been digging into the documentation and code of Keystone 6 to find a way on how to pre-filter specific rows in lists (overviews). My use case is that some users may not see other users in the list due to privacy concerns (GDPR) as that would allow them to infer what other companies have users in our system.
It seems possible to attach access control checks to operation
read, but anitemIdnever seems to be passed here to govern preventing reading of specific users, making it only possible to govern access to the whole set of records using this. It seems to be possible to get somewhat close by hiding grid columns and fields based on the user, but this is far from ideal.I see a couple of options that could work:
readand a specificitemIdwhen an item is being opened. This would also be used for the list overview to filter out items a user may not see. This is the most intuitive, but probably wouldn't scale well as access control is implemented in TypeScript and the overview is backed by a GraphQL query.Since there are also filters displayed in the overview itself, the "pre-filters" configured by the developer may not be toggled by the user and must complement the filters the users add. They also need to be able to block direct API access to these users somehow - otherwise you can circumvent the front end by using the API directly.
Keystone is pretty flexible so far, and I am fairly new to it, so it seems more likely that I just don't see it.
Beta Was this translation helpful? Give feedback.
All reactions