Hello, hope someone here can help me, this should be possible, but I cant find the solution. I want to let ppl in one role change the names of files in some catalogs. They also need to change Properties of the files. I am considering giving them control of the Zope manage system on the files, but that should mainly be for advanced users, so I would prefer making the interface myself. I have tried with the python code below, but with no luck. I get an access error. How can I do this and witch security permissions must the role have? I don't fully understand what I(or more accurate, another admin) have tried to do below, so an explanation of that would be great too! Please include newbie explanations;-) <python parameter-list:oldid,newid,tittel,contents> #context.manage_addProduct['OFSP'].manage_addFile(newid,file=contents,title=tittel) #context.manage_addProduct['OFSP'].manage_delObjects(oldid) context.manage_renameObject(oldlid, newid, REQUEST) print 'DOESN'T WORK!!!!!' return printed </python> regards Bjorge Solli -- http://www.lstud.ii.uib.no/~s0182/smile/Smiles -- Bjørge Solli - Universitas Bergensis, Norway mailto:Bjorge@Kvarteret.no icq#29210281 MSN:bobelloco@hotmail.com Møllendalsv.19, 5009 Bergen, Norway tel:55202853/91614343
<python parameter-list:oldid,newid,tittel,contents> #context.manage_addProduct['OFSP'].manage_addFile(newid,file=conte nts,title=tittel) #context.manage_addProduct['OFSP'].manage_delObjects(oldid)
context.manage_renameObject(, newid, REQUEST) almost: parent.manage_renameObjects( ids=[oldlid], new_ids=[newid] )
manage_renameObjects expects a list of objects. You don't pass the REQUEST object, unless you want ZOPE to redirect you to the manage screen. Douwe
context.manage_renameObject(oldid, newid) should be ok. (theres manage_renameObject() and manage_renameObjects(), see lib/python/OFS/CopySupport.py) cant say which permission you need though... douwe@oberon.nl wrote:
<python parameter-list:oldid,newid,tittel,contents> #context.manage_addProduct['OFSP'].manage_addFile(newid,file=conte
nts,title=tittel)
#context.manage_addProduct['OFSP'].manage_delObjects(oldid)
context.manage_renameObject(, newid, REQUEST)
almost: parent.manage_renameObjects( ids=[oldlid], new_ids=[newid] )
manage_renameObjects expects a list of objects. You don't pass the REQUEST object, unless you want ZOPE to redirect you to the manage screen.
Douwe
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Tue, 16 Jul 2002, peter sabaini wrote:
context.manage_renameObject(oldid, newid) should be ok. douwe@oberon.nl wrote:
parent.manage_renameObjects( ids=[oldlid], new_ids=[newid] )
Tried both of these. If I change 'parent' to 'context' they seem to do the same thing; Ask for user/pwd. But even if I use my manager it does not work, nor when I use an account with the desired role. The parent-version returned an error of not finding 'parent'.
cant say which permission you need though...
Anybody else? These are the permissions the role(and manager) has: Add Documents, Images, and Files Change DTML Documents Change DTML Methods Change Images and Files Delete objects In addition manager has all permissions except: Take ownership To me, it seems like the problem is somewhere else, since my manager account cant do it either. Please help! regards Bjorge -- http://www.lstud.ii.uib.no/~s0182/smile/Smiles -- Bjørge Solli - Universitas Bergensis, Norway mailto:Bjorge@Kvarteret.no icq#29210281 MSN:bobelloco@hotmail.com Møllendalsv.19, 5009 Bergen, Norway tel:55202853/91614343
Tried both of these. If I change 'parent' to 'context' they seem to do the same thing; Ask for user/pwd. But even if I use my manager it does not work, nor when I use an account with the desired role. The parent-version returned an error of not finding 'parent'. Sorry for the previous answer, I didn't see quite that it was a permission problem. If you press escape on the user/pwd box, you get to an error page saying: Error Type: Unauthorized Error Value: You are not allowed to access ... in this context You could look at the traceback and see in the source where it goes wrong. I suppose though that you'll hit CopySupport which declares manage_renameObject and manage_renameObjects as depending on the View management screens permission. If you don't want to give your users that permission, I suppose a proxy role could help out.
Douwe
On Tue, 16 Jul 2002 douwe@oberon.nl wrote:
You could look at the traceback and see in the source where it goes wrong.
How can I look at the traceback? The page only displays some suggestions. Is this bcs I'm not running the latest release of Zope?
I suppose though that you'll hit CopySupport which declares manage_renameObject and manage_renameObjects as depending on the View management screens permission.
Giving them that permisson fixed the problem. Txs. Where can I find information on what each permission gives permission to?
If you don't want to give your users that permission, I suppose a proxy role could help out.
Where can I find information on proxy roles? Thanks a lot! I've been scratching my head so much over this it hurts! regards Bjorge
Douwe
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- http://www.lstud.ii.uib.no/~s0182/smile/Smiles -- Bjørge Solli - Universitas Bergensis, Norway mailto:Bjorge@Kvarteret.no icq#29210281 MSN:bobelloco@hotmail.com Møllendalsv.19, 5009 Bergen, Norway tel:55202853/91614343
=?ISO-8859-1?Q?Bj=F8rge_Solli?= writes:
Where can I find information on what each permission gives permission to? The best way is to grep the sources.
Where can I find information on proxy roles? I expect something is written in the Zope book.
Dieter
participants (4)
-
Bjørge Solli -
Dieter Maurer -
douwe@oberon.nl -
peter sabaini