manage_changePermissions from Script(Python)
Hi; On another thread, I am having trouble using manage_clone to make a copy of one folder and put it inside of another folder. The reason I want to use clone, instead of just making a new folder is that I want the new folder to have the restricted permissions of my template. I thought since I cannot get the proxy role manager to create this clone, I would just make a new folder and set its perms up the way I want, but now I am having trouble figuring out how to call manage_changePermissions from my python script. I look at the form that calls manage_changePermissions normally, but it uses form elements with name="p2r0". I could look through that page source and try to figure out how the permissions I want to change are named (p22r3 or whatever) and try to call the method like that, but there must be a better way. Any pointers? _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
Lee Harr wrote:
Hi;
On another thread, I am having trouble using manage_clone to make a copy of one folder and put it inside of another folder.
You are using Zope 2.3.x, right? Just a quick reminder to mention that in inquiries to this list, because it is quite old and could cause confusion if people try to reproduce your problem - I wasn't mislead, this is just a general remark. About your other problem, before pasting an object into a container, it is tested if you are allowed to add an object of this metatype to that container, and in your case zope thinks you aren't allowed to do that. That causes an error. To test it, just give the non-manager user (or anonymous) permission to add a folder into your target folder and try again. As I understand what you want to do, giving appropriate writing permissions to your "people" in their folder might be the right thing to do anyway. What you see could be a bug where the copy&paste machinery doesn't respect proxy roles, but this is just a shot in the dark, and since your zope is an old version, it won't get fixed. I think my memories faulted me and that Owner thing was not what solved our copy&paste problem. About manage_changePermissions, I think you should use this method: def manage_permission(self, permission_to_manage, roles=[], acquire=0, REQUEST=None) """Change the settings for the given permission If optional arg acquire is true, then the roles for the permission are acquired, in addition to the ones specified, otherwise the permissions are restricted to only the designated roles.""" IIRC, it allows you to name the permission as it appears in the mgm. menu. HTH, oliver
participants (2)
-
Lee Harr -
Oliver Bleutgen