Re: Benutzer IDs ersetzen

Andreas Jung <[email protected]>
Newsgroups gmane.comp.web.zope.german
Organization ZOPYX Ltd & Co. KG
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Veit Schiele wrote:
> Am 01.04.2010 16:20, schrieb Ingo Schnieders:
>> Hallo zusammen,
> 
>> gibt es im Plone/ZOPE eine Möglichkeit alle Inhalte zu einer Benutzer-ID auf
>> einen anderen Benutzer umzuschreiben ?
> 
>> Anwendungsfall: Ein Mitarbeiter verlässt das Unternehmen (also auch das Plone),
>> im LDAP wird der Account irgendwann gelöscht und der Nachfolger soll sämtliche
>> Inhalte übernehmen/erben.
> 
> 
> Folgende externe Methode sollte funktionieren:
> 
> from Products.CMFCore.utils import getToolByName
> old_owner = "old"
> new_owner = "new"
> recursive = 0
> def changeOwner(self):
>     acl_users = getattr(self.aq_parent, 'acl_users')
>     user = acl_users.getUserById(new_owner)
>     catalog = getToolByName(self, 'portal_catalog')
>     brains = catalog(Creator=old_owner)
>     for brain in brains:
>         obj = brain.getObject()
>         obj.changeOwnership(user, recursive)
>         obj.indexObject()
> 

Das ganze müsste analog auch normales PythonScript funktionieren.

- -aj
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku2QqcACgkQCJIWIbr9KYzOQwCcCCDmGvJUyphCconM1zQa/6y1
6aoAoM+FPSdJXffmqqiVa7ojueGuUu5u
=Fq1k
-----END PGP SIGNATURE-----



_______________________________________________
zope mailing list
[email protected]
https://mail.dzug.org/mailman/listinfo/zope
lists.vcf (text/x-vcard, 316 B)
begin:vcard
fn:Andreas Jung
n:Jung;Andreas
org:ZOPYX Ltd. & Co. KG
adr;quoted-printable:;;Charlottenstr. 37/1;T=C3=BCbingen;;72070;Germany
email;internet:[email protected]
title:CEO
tel;work:+49-7071-793376
tel;fax:+49-7071-7936840
tel;home:+49-7071-793257
x-mozilla-html:FALSE
url:www.zopyx.com
version:2.1
end:vcard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.