If you want to restrict access to certain user, for example, to spamer, just block his IP by a piece of code in .htaccess configuration file.
Step 1. Open .htaccess file
Step 2. Make the following changes:
Order Allow,Deny
Allow from all
Deny from 145.186.14.122
Deny from 124.15.
You can to know the IP address from Apache logs or by statistical services. Lots of popular CMS have embedded monitoring tools or widen their abilities with plugins.