def migrate_listen_permissions(self):
    out = StringIO()

    ll = getUtility(IListLookup)
    out.write('obtained list lookup utility\n')

    for mapping in ll.showAddressMapping():
        path = mapping['path']
        try:
            ml = self.unrestrictedTraverse(path)
        except AttributeError:
            out.write("Mailing List '%s' not found\n" % path)
            continue
        managers = ml.managers
        list_role_manager = IRoleManager(ml)
        assign_local_role(OWNER_ROLE, managers, list_role_manager)
        # here we delete roles on the 'lists' folder so that they don't interfere
        # with roles on the list
        parent = aq_parent(aq_inner(ml))
        assign_local_role(OWNER_ROLE, [], IRoleManager(parent))
        # we also need to delete the roles on the archives folder
        assign_local_role(OWNER_ROLE, [], IRoleManager(ml.archive))
        out.write("Assigned local roles for list: '%s'\n" % ml.Title())

    return out.getvalue()
Exemple #2
0
 def _assign_local_roles_to_managers(self, ml):
     assign_local_role('Owner', ml.managers, IRoleManager(ml))
     # here we delete roles on the 'lists' folder so that they don't interfere
     # with roles on the list
     parent = aq_parent(aq_inner(ml))
     assign_local_role('Owner', [], IRoleManager(parent))
     # we also need to delete the roles on the archives folder
     assign_local_role('Owner', [], IRoleManager(ml.archive))
Exemple #3
0
 def _assign_local_roles_to_managers(self):
     ml = self.context
     assign_local_role('Owner', ml.managers, IRoleManager(ml))
 def _assign_local_roles_to_managers(self, ml):
     assign_local_role('Owner', ml.managers, IRoleManager(ml))
Exemple #5
0
 def _assign_local_roles_to_managers(self):
     ml = self.context
     assign_local_role('Owner', ml.managers, IRoleManager(ml))
Exemple #6
0
 def _assign_local_roles_to_managers(self, ml):
     assign_local_role('Owner', ml.managers, IRoleManager(ml))