Skip to content

What is the alternative for item-level access control for query operations ? #9076

Answered by borisno2
NadimD asked this question in Questions
Discussion options

You must be logged in to vote

Example : In the query access control, I read the user's roles in the session but I can't currently access the item "forum" that is being called in order to see if it has permissions and roles attached to it.

You should be able to use access.filter.query to filter the "forum" list being called. So instead of checking a value on the item and returning true or false you can filter for that value. As an example in my project I am filtering the enrolments a user can read based on a session id - https://github.com/borisno2/on-the-hill-drama-club/blob/main/src/keystone/helpers.ts#L49 - I have handled fairly complex access requirements with filter I would be interested in seeing an example whe…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@NadimD
Comment options

@dcousens
Comment options

@borisno2
Comment options

Answer selected by NadimD
@NadimD
Comment options

@dcousens
Comment options

@NadimD
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants