Recommended way to disable query access on one list but allow read access on relationship field in another list #9329
Replies: 1 comment
-
Hi,
If you allow access to a resource from inside some query then this is no different (from hostile actor point of view) from giving access explicitly. Unless you are exclusively using persisted queries or limiting other way (virtual field, custom query), anyone can execute a query that takes additional data (except from Depending on your exact requirement there several ways you could make it happen instead:
You could probably make a two-way relationship between User and Task and write more complex filter that would take account of Task.assignedTo when checking User permission. It could work, but since you have multiple tables like this, performance would be probably very bad.
Anyway solution 1 or 2 is what I would recommend. |
Beta Was this translation helpful? Give feedback.
-
I have some access functions as follows:
A user list:
And a task list:
I only want admin users to be able to query the users list, and logged in users to be able to query task.assignedTo e.g.
assignedTo
field is not populating because of the access.query restriction on user list.I know I can create a virtual field for the task.assignedTo and use context.sudo().db.Task, but I have many lists with a similar relationship to a user and it seems like Keystone should provide a way to configure this.
I think my expectation would be that the read access on the relationship field should override the list access on the related list. e.g Task.assignedTo field access policy should override User list access policy.
Beta Was this translation helpful? Give feedback.
All reactions