def METHOD_NAME(self, rules: None = None) -> None:
    foirequest = self.message.request
    if rules is None:
        rules = Rule.objects.all()
    if self.active_only:
        rules = rules.filter(is_active=True)
    rules = (
        rules.filter(
            Q(jurisdictions=None) | Q(jurisdictions=foirequest.jurisdiction)
        )
        .filter(Q(publicbodies=None) | Q(publicbodies=foirequest.public_body))
        .filter(
            Q(categories=None)
            | Q(categories__in=foirequest.public_body.categories.all())
        )
        .order_by("priority")
    )
    for rule in rules:
        if rule.references_re:
            if not rule.references_re.search(foirequest.reference):
                continue
        yield rule