def __init__( self, session, user, group_svc, links_svc, flag_svc, flag_count_svc, moderation_svc, user_svc, has_permission, ): self.session = session self.group_svc = group_svc self.links_svc = links_svc def moderator_check(group): return has_permission("moderate", group) self.formatters = [ formatters.AnnotationFlagFormatter(flag_svc, user), formatters.AnnotationHiddenFormatter(moderation_svc, moderator_check, user), formatters.AnnotationModerationFormatter(flag_count_svc, user, has_permission), formatters.AnnotationUserInfoFormatter(self.session, user_svc), ]
def __init__(self, session, user, group_svc, links_svc, flag_svc, flag_count_svc, moderation_svc, has_permission): self.session = session self.group_svc = group_svc self.links_svc = links_svc self.formatters = [ formatters.AnnotationFlagFormatter(flag_svc, user), formatters.AnnotationHiddenFormatter(moderation_svc, user), formatters.AnnotationModerationFormatter(flag_count_svc, user, has_permission) ]
def __init__(self, session, user, group_svc, links_svc, flag_svc): self.session = session self.group_svc = group_svc self.links_svc = links_svc self.formatters = [formatters.AnnotationFlagFormatter(flag_svc, user)]