[Product Developers] Re: Insufficient Privileges when executing a script that modified content-objects.

Zach Seifts bigpappasmurf at gmail.com
Wed Mar 28 19:14:02 UTC 2007


Martin,

First off I wasn't sure which list to put it in.

I am using the invokeFactory function like your saying in my script
but that is to create the new object. I think I've got it narrowed
down to whenever I try to modify existing content it throws the error.
It does not display a traceback, but a plone page saying "You do not
have sufficient privileges to view this page. If you believe you are
receiving this message in error, please send an e-mail to" I'm still
looking for a traceback for the Unauthorized error. I've tried giving
the script a proxy roll of Manager and this didn't help either.

On Mar 28, 2:41 pm, Martin Aspeli <optil... at gmx.net> wrote:
> 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
>
> _______________________________________________
> Product-Developers mailing list
> Product-Develop... at lists.plone.orghttp://lists.plone.org/mailman/listinfo/product-developers





More information about the Product-Developers mailing list