def METHOD_NAME(self, appstruct):
    """
    Validate the ``groupid`` to make sure it adheres to authority restrictions.
    ``groupid`` is only allowed if the authority of the group associated
    with it is not the default authority—i.e. this is a third-party group.
    :arg appstruct: Data, which may or may not contain a ``groupid`` entry
    :type appstruct: dict
    :raise h.schemas.ValidationError:
    """
    groupid = appstruct.get("groupid", None)
    if groupid is None:  # Nothing to validate
        return
    if (self.group_authority is None) or (
        self.group_authority == self.default_authority
    ):
        # This is a first-party group
        raise ValidationError(
            # pylint:disable=consider-using-f-string
            "{err_msg} '{authority}'".format(
                err_msg=_(
                    "groupid may only be set on groups oustide of the default authority"
                ),
                authority=self.default_authority,
            )
        )
    groupid_parts = split_groupid(groupid)
    if groupid_parts["authority"] != self.group_authority:
        # The authority part of the ``groupid`` doesn't match the
        # group's authority
        raise ValidationError(
            # pylint:disable=consider-using-f-string
            "{err_msg} '{groupid}'".format(
                err_msg=_("Invalid authority specified in groupid"), groupid=groupid
            )
        )