hide field in account creation

default discord avatar
xavierpacheco
5 months ago
5

I have a roles field and I need to hide it during account creation:


I have tried this however when I create an account I have the option to choose from available. How do I hide it?

  • default discord avatar
    notchr
    5 months ago

    @xavierpacheco Morning! This would be a field-level access control configuration



    https://payloadcms.com/docs/access-control/fields


    Specifically the "Read" operation

  • default discord avatar
    xavierpacheco
    5 months ago

    Hello, I already have it config as a field Level Access



    The problem is, upon account creation it shows up and I don't want it to show up during account creation



    In this case, this is an admin only check



    So a normal user creating account should't see the role selector

  • default discord avatar
    notchr
    5 months ago

    is it set to required?



    I'm surprised it would show if you've set field level access control

  • default discord avatar
    xavierpacheco
    5 months ago

    Hey, no its not required

  • default discord avatar
    ibrahem1105
    5 months ago

    have you checked your !isAdmin condition? also maybe trying a condition like:


    {


    admin: {


    // check docs for example


    condition:(

    ,

    ,{user}) => {


    // user exists and not admin


    }


    }


    }


    the access control will protect the backend, and this should hide in dashboard

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.