[Product Developers] Insufficient Privileges when executing a script that modified content-objects.
Martin Aspeli
optilude at gmx.net
Wed Mar 28 18:41:02 UTC 2007
Zach Seifts wrote:
This is possibly a more appropriate question for plone-users, but oh well.
> I have a script that converts every object of a certen content-type to
> another content-type, but the problem I'm coming across with this
> script is after I've ran it on plone 2.5.2 it redirects me to a page
> that says "Insufficent Privileges".
For this type of thing, an External Method may make more sense than a
pyscript.
> In this script I'm using "parent.manage_renameObjects(link_id,
> old_link_id)" to rename the old object and I'm using the portal
> factory to create a new object of the new content-type.
If you're creating things in code, then you shouldn't use
portal_factory; instead, you may write:
folder.invokeFactory('ContentTypeName', 'my_id')
obj = getattr(folder, 'my_id')
obj.setTitle("foo")
obj.setSomethingElse("bar")
obj.reindexObject()
> The plone instance I'm working with is a migrated 2.4.1 instance into
> 2.5.2. I've had it work in a plain 2.5.2 instance but this one is
> causing me trouble.
You need to include a full traceback of the Unauthorized error.
Martin
More information about the Product-Developers
mailing list