disable blockName update

default discord avatar
rrums
7 months ago
5

Hello all, can I disable blockName (from block field) from being changed by users?


I want to set it programmatically

  • default discord avatar
    hades200082
    7 months ago

    You can use the access controls on the field. Use the create and update fields to set a function that will determine if access is allowed or not.



    https://payloadcms.com/docs/access-control/fields
  • default discord avatar
    rrums
    6 months ago

    hey @hades200082, thanks for replying



    In my case, I want to restrict users to input blockName manually, but users still able to update any kind of fields


    blockName is not accessible from access controls on the field, no?



    I want to have same behavior as array field, that we can't change the name, it's generated by payload

    Screenshot_2023-05-10_at_11.20.15.png
    Screenshot_2023-05-10_at_11.23.40.png
  • default discord avatar
    noheadphones
    6 months ago

    I don't think that part is currently customisable, it's intended just for editorial use though so you can label each block a little better

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.