<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def allow(self, act, obj=None):
 """Determine where a given action on a given object is allowed. """

        objc = obj.components if obj is not None else []
        try:
            return self.tree[act.components + objc] == 'allow'
        except KeyError:
            return False