Forum Discussion

Benjamin's avatar
Benjamin
Mentor
8 years ago

How to implement country bans

For compliance reasons, we want to ban users or at least raise a flag for our staff as soon as a user from a country under embargo wants to interact with us.   Given the fact that IP ranges can var...
  • ChiaraS's avatar
    8 years ago

    you could call a webservice (like http://ip-api.com/docs or https://db-ip.com/api/) on user login to get the country (users could still go thru proxies, so not 100% accurate) and for example send a PM to a moderator in case of a specific country.
    You could store the country value either in the default "Location" user field or into a custom one.
    You could even ban the user via REST automatically (/t5/Developer-Documentation/bd-p/dev-doc-portal?section=commv1&leaf-id=User.moderation#User.moderation.ban ) but I wouldn't advise to do that.