Is it possible to only allow changes if locale is equal X?
I have some fields that is not localized, I want them to only be editable when on a specific locale.
It's some checkboxes regarding SEO - see image 🙂
You could write a
beforeValidatehook that does your own access control of sorts by looking at the
req.localeand the
req.userto throw a 403. The issue with doing this is that you have no feedback for the user that they won't be able to do this. The normal
accesscontrol built into Payload informs the UI on what the user can do to prevent this UX problem.
We do have a feature planned for locale based
accesscontrol so the answer might just be to hang tight :/
Star
Discord
online
Get dedicated engineering support directly from the Payload team.