Because this problem is due to an attribute of a user (namely their location), use a 4xx response code to indicate a user issue. The 451 response code has been suggested for use in cases where content cannot be displayed for legal reasons.

  1. From the PingAuthorize Policy Editor, go to the Policies tab.
  2. Select Users viewing shared memes.
  3. Click + Advice and Obligations.
  4. Click + Add Advice and select Denied Reason.
  5. For the name, replace Untitled with Send "not permitted" error.
  6. From the Applies to drop-down list, select Deny.
  7. For a Payload value, enter {"status": 451, "message": "Restricted", "detail": "Not permitted per regulation"}.
  8. Click Save changes.
    You have a new advice, which looks something like the following image.

    Screen capture of advice definition