#Access Permissions with Local API mirroring Admin?

5 messages · Page 1 of 1 (latest)

modest panther
#

For my first Payload Project, I carefully setup access controls in my admin -- creating a system with user roles and user groups (with roles) -- and everything is setup in a way that I'm quite pleased with.

When I began working on my front end, I was hoping that it would be quite easy to use the local api and to show a collection and to use the logged in user to show all docs that they would have access to based on the admin.

I found the overrides in the query - but what I'm struggling with, is it seems like I need to reimplement the logic. I ended up getting 401 errors if a user isn't logged in (was hoping to get zero docs)...

Is there a simple way to approach creating a front end whereby access on collections/docs mirrors the admin? I had assumed that this was in the DNA of Payload and am a bit confused.

lilac frostBOT
timid ferry
modest panther
#

Oooo... If that cleans up the 401 when no docs are available... I wonder if the rest of my access controls will work! Thanks for the tip!

modest panther
#

Amazing! That was the solution to my problem! Thank you, @timid ferry !