Restrict Unauthenticated user to open pdf files - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

Restrict Unauthenticated user to open pdf files

  • Restrict Unauthenticated user to open pdf files
  • Hello Telerik Team,

    I have uploaded pdfs through upload documents & files links by sitefinity admin side. I have functionality to search pdfs of my site with search and search result widgets. Now i want to create functionality like if user clicks on pdf link, he/she must be redirected to my custom login page. And if role is right than he/she must able to open pdf. I have my custom tables of users and roles. How should i do this ? I have also checked link below but no success.

    www.sitefinity.com/.../securing-individual-files

    Regards,
    Nirav Golani
  • Hello Team,

    I followed below url:

    www.sitefinity.com/.../how-do-you-preventing-direct-linking-to-website-files


    Took the code from there but no success again. Search results will be displayed to all users but I want to restrict users from accessing pdfs. Only registered users with my custom tables only see pdfs. I even created handler as mentioned in the link.

    Please help asap. It is very urgent. I will be thankful. 
  • ^ . BUMP . ^

    Need to have all users / guests able to view files (pdfs), but need to restrict the ability to open a file (pdf) to those users who have been authenticated.  Is this possible with Sitefinity?  Currently running Sitefinity 5.1 with the particular site.  Thanks!
  • Hello Andrew,

    You can set the View permissions of the document and/or of the document library to Authenticated only. You can check the permission from Content -> Documents and files and click on the Actions link of your Library and then select Set permissions. You may also explicitly deny anonymous users to view the documents and the document library. This way anonymous users will not be able to view the documents under this library.

    Regards,
    Sabrie Nedzhip
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
  • Hi Sabrie,

    Your comment only outlines how to restrict access. That part is easy. The question was "how do you send the person to your custom login page when they click on that document link?" 

    Do you know how we go about that?

  • You can configure a front end login page url following these steps: docs.sitefinity.com/frontend-login-page

    If the permissions for the documents are setup properly, Sitefinity will automatically redirect the user to the page configured as the frontend login page with a ReturnUrl.