Commit 9473c9eb authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add a new method updateRoleMappings


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5805 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5c08879d
......@@ -251,4 +251,19 @@ class RoleProviderBase:
, base_category_script=base_category_script
)
security.declareProtected( ManagePortal, 'updateRoleMappings' )
def updateRoleMappings( self, REQUEST, manage_tabs_message=None ):
"""Update the local roles in existing objects.
"""
portal_catalog = self.portal_catalog
i = 0
for brain in portal_catalog(portal_type = self.id):
obj = brain.getObject()
userdb_path, user_id = obj.getOwnerTuple()
obj.assignRoleToSecurityGroup(user_name = user_id)
i += 1
return self.manage_editRolesForm(REQUEST, manage_tabs_message='%d objects updated' % (i,))
InitializeClass(RoleProviderBase)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment