Пример #1
0
 def process_assignment(self):
     for role_id in self.assignable_roles():
         for user in common.get_users(role_id):
             key = self.make_id(user.login, role_id)
             if key in self.request.form.keys():
                 self.prm.assignRoleToPrincipal(role_id, user.login)
             else:
                 self.prm.unsetRoleForPrincipal(role_id, user.login)
Пример #2
0
 def process_assignment(self):
     for role_id in self.assignable_roles():
         for user in common.get_users(role_id):
             key = self.make_id(user.login, role_id)
             if key in self.request.form.keys():
                 self.prm.assignRoleToPrincipal(role_id, user.login)
             else:
                 self.prm.unsetRoleForPrincipal(role_id, user.login)
Пример #3
0
 def get_transcribers(self):
     transcribers = []
     transcriber_role = self.get_transcriber_role()
     users = common.get_users(transcriber_role)
     for user in users:
         if self.user_is_assigned(user.login, transcriber_role):
             transcribers.append(user)
     return transcribers
Пример #4
0
 def get_transcribers(self):
     transcribers = []
     transcriber_role = self.get_transcriber_role()
     users = common.get_users(transcriber_role)
     for user in users:
         if self.user_is_assigned(user.login, transcriber_role):
             transcribers.append(user)
     return transcribers
Пример #5
0
 def role_listing(self, role_id, editable):
     listing = []
     users = common.get_users(role_id)
     if not users:
         return _("No users available for this role.")
     for user in users:
         data = {}
         data["title"] = IDCDescriptiveProperties(user).title
         data["name"] = self.make_id(user.login, role_id)
         data["is_assigned"] = self.user_is_assigned(user.login, role_id)
         data["editable"] = editable
         listing.append(data)
     formatter = TableFormatter(
         self.context, self.request, listing, prefix="assignment",
         columns=self.columns)
     formatter.updateBatching()
     return formatter()
Пример #6
0
 def role_listing(self, role_id, editable):
     listing = []
     users = common.get_users(role_id)
     if not users:
         return _("No users available for this role.")
     for user in users:
         data = {}
         data["title"] = IDCDescriptiveProperties(user).title
         data["name"] = self.make_id(user.login, role_id)
         data["is_assigned"] = self.user_is_assigned(user.login, role_id)
         data["editable"] = editable
         listing.append(data)
     formatter = TableFormatter(self.context,
                                self.request,
                                listing,
                                prefix="assignment",
                                columns=self.columns)
     formatter.updateBatching()
     return formatter()