code: def can(self, action, subject, **conditions):
          
          for rule in self.relevant_rules_for_match(action, subject):
              if rule.matches_conditions(action, subject, **conditions):
                  return rule.base_behavior
          return False
docs: Check if the user has permission to perform a given action on an object