Query by publishDate is not working #702
-
BackgroundI want to have a simple scheduled publish feature like this Repro Steps
http://localhost:3333/admin/collections/test-drafts/62be8d54722f5bd46633ca9f
Expected behaviorAccording to requirement and the description from the code snnipet, it should return the version that publishDate smaller than today. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @Stupidism, I'm glad to see you are exploring this solution more. Looking at the code for the access control, it is doing exactly what you're asking it to. When you are querying in step 5, try from an incognito window or add a step to logout from the admin UI first. I was able to do this from your repro to be sure. If your app will have authenticated users and admin users for the panel either by role or using a separate auth collection, remember to add those conditions to your read access function as well to gate the content. |
Beta Was this translation helpful? Give feedback.
Hey @Stupidism,
I'm glad to see you are exploring this solution more. Looking at the code for the access control, it is doing exactly what you're asking it to.
The access control on TestDrafts for
read
first checks if a user is logged in before querying publishDate. Unless you have logged out it won't bother querying the way you are expecting.When you are querying in step 5, try from an incognito window or add a step to logout from the admin UI first.
I was able to do this from your repro to be sure.
If your app will have authenticated users and admin users for the panel either by role or using a separate auth collection, remember to add those conditions to your read access function as …