«Restricted Files» plugin (version 2.1, 2016-12-11)

Version 1.2 is out!
Admin interface has been improved.
Now, the messages for unauthenticated and unauthorized users can be edited in WYSIWYG editor with support for HTML tags, BBCodes and Markdown: