[Zope] add role to user (using API)

Jens Vagelpohl jens at dataflake.org
Sun Mar 27 16:14:03 EST 2005


On Mar 27, 2005, at 22:57, Malthe Borch wrote:

> Hello list, ---
>
> I'm trying to use the MembershipTool to append a role to one of my 
> users, using
> the setLocalRoles API-function. How does this function work?
>
> I want to upgrade a user from plain 'Member' to a new role, in a form 
> script.
>

Are you confusing global roles as stored on a user/member with local 
roles, as stored on an object in the ZODB?

The API document isn't too confusing, I think:

     def setLocalRoles(obj, member_ids, member_role, reindex=1):
         """ Add local roles on an item.

         Permission -- Always available
         """

You pass in the object (folder, content object, etc) you want to set 
local roles on, a sequence of member IDs, and the role name.

jens



More information about the Zope mailing list