(self, fact)
| 13 | self.rules = rules |
| 14 | |
| 15 | async def is_fact_allowed(self, fact): |
| 16 | allowed = True |
| 17 | for rule in await self._applicable_rules(fact): |
| 18 | if await self._is_ip_rule_match(rule, fact): |
| 19 | allowed = await self._rule_judgement(rule.action) |
| 20 | continue |
| 21 | if await self._is_regex_rule_match(rule, fact): |
| 22 | allowed = await self._rule_judgement(rule.action) |
| 23 | return allowed |
| 24 | |
| 25 | async def _applicable_rules(self, fact): |
| 26 | applicable_rules = [] |