-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Description
Documentation Issue
We have the following setup: We have one auth enabled collection "User". All other collections are not auth enabled, but we restrict access to the auto-generated CRUD endpoints via the access: { read: .., create: ...} configuration where we provide functions which check if the user is authenticated for the "User" collection.
Is it possible to somehow limit the access for custom endpoints in collections which are not auth enabled?
The documentation lacks information about this: https://payloadcms.com/docs/rest-api/overview#custom-endpoints.
The request object that was provided to the custom endpoint handler contained no authenticated user object. I assume the user was missing, because Passport would not kick in here to set the user on the request, when the endpoint is configured to not require authentication.
Additional Details
In case it is currently not possible to restrict access to custom endpoints the same way we can do this for the standard CRUD endpoints, this would be feature request.