Can you tell me how can I check in a sync function that the current create/update is coming from a public or admin rest call? The usecase is simple, I would like to allow specific documents to be created only through the admin port(automatically created by a script who lives on the server)
When requests come in the admin port, the authorizing users sync function calls such as (requireUser, requireRole, requireAccess, etc) are all “no-ops” and they have no effect.
So if you add requireRole("someNonexistentRole") to your sync function handling for those specific docs, then it will only work over the admin port, and will otherwise be rejected.