'hidden' member field

I have added some 'Member fields' TTW, and I want to add one more (Bool), which should be not visible for the users (but visible for the admin).

Security is not 'super important', but is there a way to do this TTW.

I can do it with CSS, but a permission based solution would be better…

According to https://github.com/plone/plone.app.users, profile fields are extended via plone.schemaeditor and it can be set via plone.supermodel xml format. Permissions are set in xml via the sample code below. I think it is worth a try.

<field type="zope.schema.TextLine"
        name="one"
        security:read-permission="zope2.View"
        security:write-permission="cmf.ModifyPortalContent">
    <title>One</title>
</field>

You can also try form:omitted: https://github.com/plone/plone.autoform/blob/master/plone/autoform/supermodel.txt#L53

Thanks for your help.
This is what I did (in case someone else needs to do this one day…)

My site was live, so I wanted to do this TTW (through the web).

  1. I went to /portal_setup and exported 'user schema' (which gives you a userschema.xml file)

  2. I added the following to the userschema.xml file

     <field type="zope.schema.Bool" users:forms="In User Profile"
     name="myfield"
     security:read-permission="cmf.ModifyPortalContent"
     security:write-permission="cmf.ModifyPortalContent">
     <title>My title</title>
     </field>
    
  3. I tar/zipped the file (on OS X / Linux this would be tar -zcvf myuserschema.tar userschema.xml

  4. In /portal_setup/manage_tarballImport I chose 'myuserschema.tar' and imported it.

PS: In fact, I made a copy/paste of the site ( myzope:8080/manage_main ) and tested it on that first…

For the record I tested the trick but without the ZMI, by using edit as Xml in the Fields management of the Plone Control Panel. It worked but only half the time; now you see it, now you don't. After a few minutes of bewilderment i restarted both Zeo clients and everything was working fine, seems not is perfect in Plone Xml editor, but nice trick indeed @h2o ! Actually if there is only one field hidden in a tab the tab itself is not displayed, so it seems to work really well.

Cool! I may have a need for this in the future.

Slightly related: Reordering fields with the UI is sometimes not working (both with members, dexterity content types and collective.easyform, then you can use the same approach (or for dexterity/easyform TTW: edit the xml-schema TTW)

I have a local setup on my PC, I changed the xml and added a new field as mentioned in the link, but that change is not getting reflected, my newly added field is not visible on the Member Fields page,

I even rebuild using the following command, but of no help.

bin/buildout -c develop.cfg

I tested my suggestion on a fresh Plone 5.1 setup, and it works 'perfectly'. I did not even have to restart.
Maybe you have a typo in your field?

I would do the following:

  1. Add a new dexterity content type
  2. Add the fields you need to it (TTW, in the dexterity editor)
  3. Copy the fields (from there) to the user schema
  4. import it in Plone

(make sure you tar the new userschema.xml (not the old one).