Is possible to manage access control over the each block field?
Eg: I have an admin user and a customer, but admin can see 5 block type fields, and customers only 2
Currently you cannot apply access control to blocks themselves - however you can restrict access for the fields within the block. If you just need to restrict customers from reading certain data, this could be enough for you. Or there might be something more suitable depending on your specific usage - if you want to share more details on your setup here we can discuss.
Hello Jess, thanks for the answare!! I really apreciate your work together with the other members of Payload Team, you are incredible!!!
i tried to restrict the block field based on my access control rules, but I needed the field to have the same name, to avoid a large variation of data... anyway, I wasn't successful, my solution was to copy the field of blocks from the payload's official code and apply my rules there, that way, my configuration for blocks it is like:
{
type: "blocks",
name: "fieldName",
labels: {...},
admin: {
components: {
Field: createBlock({
condition: (args) => myConditionFunction(args)
})
}
},
}
i really intresting to make a pull request to transform this functionality native
@jesschow
@math536 what is this
createBlock
you created? I have a similar issues and this looks like the best approach so far... option B would be something like this
https://discord.com/channels/967097582721572934/1052475936181862470Star
Discord
online
Get dedicated engineering support directly from the Payload team..