Restrict acces to PDF files in Ultimate Membership Pro

I need to restrict access to some kind of files, like PDFs, that are stored in the server (link for example among Wordpress media files), but are not web pages.
How can I do it?
I have found only an article about this topic but is referred to an other similar plugin.