def authentication_requirement(self, target, permission):
        if isinstance(target, tuple):
            req = getattr(target[1], 'authentication_required', None)
            if req is False:
                return None
            elif req is not None:
                return target[0]  # return the object the method is bound to, as this is what permissions are set upon
            else:
                return self.authentication_requirement(target[0], 'write')  # assume all methods are write-dangerous
        elif permission in getattr(target, 'authentication_required', []):
            return target
        elif isinstance(target, Document):
            return self.authentication_requirement(target.collection, permission)
        elif isinstance(target, Collection):
            return self.authentication_requirement(target.application, permission)
        elif isinstance(target, Application):
            return self.authentication_requirement(target.suite, permission)
        else:
            return None
Check the target to see if it or any of its 'parents' require authentication.
dataset/ETHPy150Open JeffHeard/sondra/sondra/auth/request_processor.py/AuthRequestProcessor.authentication_requirement