List Filter for a Collection or Global #13606
artimalternar
started this conversation in
Feature Requests & Ideas
Replies: 1 comment
-
|
I ran into similar issues. I'm currently working on implementing a real ABAC (attribute-based access control) solution in PayloadCMS. This way, only the items matching the However, I also found it a bit hacky to detect whether it's a "list" access or a single "read" access. In my opinion, these should really be two separate hooks. |
Beta Was this translation helpful? Give feedback.
0 replies
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
storeswhereuseris from the same country as thestoreAnd basically it all works, I can do this in
Accessfunction but when you I returnfalsefor e.g.read: AccessI 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 tohidenot 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->listSince looks like you have some architectural drawback there. TheTableitself 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
filterhookinCollectionConfigBeta Was this translation helpful? Give feedback.
All reactions