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)
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
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()
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()