<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def can(self, action, subject, **conditions):
 """ Check if the user has permission to perform a given action on an object """

        for rule in self.relevant_rules_for_match(action, subject):
            if rule.matches_conditions(action, subject, **conditions):
                return rule.base_behavior
        return False