[Zope-CMF] New CMF tool has bogus __roles__
Jon Edwards
jon@pcgs.freeserve.co.uk
Sat, 2 Feb 2002 13:20:13 -0000
> The only thing I've found that works is the following truely
> horrible kludge to initialize in the products's __init__.py:
>
> # add after utils.ToolInit(...)
> setattr(PostingsTool, '__roles__', '('Anonymous', 'Manager',))
I noticed in PortalFolder.py (CMF 1.2) there's a couple of lines (just
before def manage_addFolder) -
security.setPermissionDefault(AddPortalContent, ('Owner','Manager'))
security.setPermissionDefault(AddPortalFolders, ('Owner','Manager'))
Maybe you could use something similar in your PostingsTool?
I'm low on the ladder of Python-Product-Zen (as you've probably noticed), so
I may have got it wrong! But I was planning to use this in a
"WorkgroupFolder" product, to setup a members-only area. i.e. -
security.setPermissionDefault(View, ('Owner', 'Manager', 'Workgroup
Member'))
... same for ListFolderContents and AccessContentsInformation
Hope that helps?
Cheers, Jon