Larry Pitcher wrote:
Hi,
I'm having an issue with the ownership of a Remember-based user type.
I'm using the AutoRole product to give Anonymous Users some special
roles. The result of this is that every user is logged in as "Anonymous
User" when they use the "join" button to create themselves a user. The
user "Anonymous User" then has the "Owner" role on the resulting new
user object.
I would like to take that "Owner" role away when the user object is made
its own "Owner". Where is the code that tells a new user object who its
owner is?
the code that tells a member object who its owner is is the same code
that tells any new object who its owner is; it's not specific to
Remember at all.
the base member class, however, already has a 'fixOwnership' method that
should be helpful here:
http://dev.plone.org/collective/browser/Products.remember/trunk/Products/remember/content/member.py#L103
this should get called any time you change the id of the member object,
as well as by the IObjectMoved event listener for member objects. i
would expect that it would already be doing what you need, but maybe
something isn't right w/ your workflow states when this method is
getting triggered.
in any event, you should be able to accomplish what you want by making
use of this method at the right time in your workflow. if it's not
working, it probably means the getUser call is failing, i.e. a user
can't actually be generated by that member object yet, so you'll have to
dig in and figure out why that is.
also, you'll probably want to explicitly pass in 'Anonymous User' as the
old_id argument so it will be removed from having the Owner local role.
-r
--
Archive:
http://www.openplans.org/projects/remember/lists/remember/archive/2008/12/1230625872564
To unsubscribe send an email with subject "unsubscribe" to
[email protected]. Please contact [email protected] for
questions.