[Zope] manage_changePermissions from Script(Python)
Oliver Bleutgen
myzope@gmx.net
Fri, 10 Jan 2003 19:51:18 +0100
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