def METHOD_NAME(self):
    fields = super().METHOD_NAME()
    request = self.context.get("request")
    # allow invitation state to be modified under the right conditions
    if request and request.user and self.instance:
        if self.instance.invited == request.user:
            fields["accepted"].read_only = self.instance.revoked
            fields["declined"].read_only = False
        if self.instance.sender == request.user:
            fields["revoked"].read_only = False
    return fields