I've been banging my head on this for a day, and it's time to ask for help.

Martin's borg.project has the following code (simplified here) which works 
fine for Archetypes:

    portal_types = getToolByName(context, 'portal_types')
    for fti in portal_types.listTypeInfo():
        factory = getattr(fti, 'factory', None)
        product = getattr(fti, 'product', None)
        dispatcher = getattr(context, 'manage_addProduct', None)
        product_instance = dispatcher[product]
        factory_method = getattr(product_instance, factory, None)
        factory_instance = getattr(factory_method, 'im_self', None)
        factory_class = factory_instance.__class__
        role_permission = getattr(factory_class, factory+'__roles__', None)

Unfortunately, non-archetype content (borg.project included) doesn't have a 
"product", and I can't find any way to find a corresponding PermissionRole 
object for those.

[I do wish you'd made "default_addable_types" a utility, Martin...]
-- 
derek



_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to