List Filter for a Collection or Global #13606
artimalternar
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am playing around permissions. I need to restrict access based on collection item data. e.g. i want a user to give access only to those items that are conditioned to the user. e.g. operate on only those
stores
whereuser
is from the same country as thestore
And basically it all works, I can do this in
Access
function but when you I returnfalse
for e.g.read: Access
I still can see collection item in list view in admin panel. And when I click it I get messageitem does not exists or you do not have access
. This looks wierd, since I should not see in in the list view in first place. Can you suggest how tohide
not permitted items in the listI've digged into the source code, and I do not see any checks for permissions when list view is rendered
I could not find any collection `hook' where I could filter out not-permitted items from the list view
also I even could not find any workaround ( with custom view )
components
->views
->list
Since looks like you have some architectural drawback there. TheTable
itself is rendered before the custom component is renderedhttps://github.com/payloadcms/payload/blob/main/packages/next/src/views/List/index.tsx#L229
https://github.com/payloadcms/payload/blob/main/packages/next/src/views/List/index.tsx#L245
https://github.com/payloadcms/payload/blob/main/packages/next/src/views/List/index.tsx#L361
what I expect is that custom list view component would have control over data it's beeing rendering. or, which is better, to have
filter
hook
inCollectionConfig
Beta Was this translation helpful? Give feedback.
All reactions