On 2/28/11 1:35 PM, Andreas Jung wrote:
Plone 4.0.3

I have a custom content-types AuthoringPublishedContent (derived from
ATDocument).

Instances of this type should be created as content of some folder
generated by some backend
logic (and only there). That's why the content-types is not implictly
addable.

On the destination folder I enabled folder restrictions

         # ensure folder restrictions on destination folder
         dest_folder.setConstrainTypesMode(constraintypes.ENABLED)
         dest_folder.setLocallyAllowedTypes(['Folder',
'AuthoringPublishedDocument', 'File', 'Image', 'Document'])
         dest_folder.setImmediatelyAddableTypes(['Folder',
'AuthoringPublishedDocument', 'File', 'Image', 'Document'])

Creating a new AuthoringPublishedDocument instance inside this folder
fails badly:

Traceback (innermost last):
   Module ZPublisher.Publish, line 127, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 47, in call_object
   Module zopyx.authoring.browser.conversionsfolder, line 228, in
generate_html_pdf
   Module Products.ATContentTypes.lib.constraintypes, line 261, in
invokeFactory
Unauthorized: Disallowed subobject type: AuthoringPublishedDocument

getAllowedContentTypes() for this particular folder returns only the types
of standard Plone but not my own type? Why this?

Not sure I get the full picture but you can only blacklist locally,
not white list. Meaning, you can't "Allow this type here" if it is
not allowed in the FTI for the container type. Only the other way
around works.

This has annoyed me to no end more than once.

Or I didn't get your question,

        Raphael


Andreas

 >
/home/ajung/.buildout/eggs/Products.ATContentTypes-2.0.7-py2.6.egg/Products/ATContentTypes/lib/constraintypes.py(260)invokeFactory()
-> if not type_name in [fti.getId() for fti in self.allowedContentTypes()]:
(Pdb) print self.allowedContentTypes()
[<DynamicViewTypeInformation at /Plone/portal_types/Document>,
<DynamicViewTypeInformation at /Plone/portal_types/File>,
<DynamicViewTypeInformation at /Plone/portal_types/Folder>,
<DynamicViewTypeInformation at /Plone/portal_types/Image>]






_______________________________________________
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


_______________________________________________
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers

Reply via email to