Lookup the proper registry for this permission.
        Returns (<registry>, <key>) where registry is the proper lookup
        and key is the generated key to use for the permission.

def _lookup(self, bearer, target=None, permission=None):
        """Lookup the proper registry for this permission.
        Returns (<registry>, <key>) where registry is the proper lookup
        and key is the generated key to use for the permission."""

        if target is None:
            key = (bearer, permission)
            lookup = self.bearer

        elif permission is None:
            key = (bearer, target)
            lookup = self.target

        else:
            key = (bearer, target, permission)
            lookup = self

        return lookup, key