I needed to enable the User Folders feature of Plone from within my product. My first thought was to use a Generic Setup profile, but the solution was setuphandlers.py.
I inspected the Enable User Folders button on the Security settings page of Site Setup, and saw the attribute was named enable_user_folders. I tried to find a generic setup profile I could edit.
The closest I got was adding enable_user_folders to properties.xml. This turned the attribute on in the ZMI, but not in Site Setup and User Folders were not enabled.
Then I found a reference to
security.enable_user_folders
in a setuphandlers.py file from the Rhaptos git repo.
So, I added these lines to setupVarious in my setuphandlers.py.from plone.app.controlpanel.security import ISecuritySchema site = context.getSite() security = ISecuritySchema(site) security.enable_user_folders = True
Now, when I install my product, User Folders are enabled automatically.
Note that you need to make sure setupVarious is turned on in configure.zcml.
<genericsetup:importStep name="your.package" title="your.package special import handlers" description="" handler="your.package.setuphandlers.setupVarious" />
Hope this helps someone.