Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

hide field in account creation

default discord avatar
xavierpacheco2 years ago
6

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
    notchr2 years ago
    @316955211870502913

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



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

    Specifically the "Read" operation

  • default discord avatar
    xavierpacheco2 years 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
    notchr2 years ago

    is it set to required?



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

  • default discord avatar
    xavierpacheco2 years ago

    Hey, no its not required

  • default discord avatar
    ibrahem11052 years 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

  • default discord avatar
    rowdy_9300112 months ago

    Hi, I also got the same situation can you please provide what you did to overcome this issue

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.