+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Restrict Unauthenticated user to open pdf files

Restrict Unauthenticated user to open pdf files

6 posts, 0 answered
  1. Nirav
    Nirav avatar
    8 posts
    Registered:
    24 Jun 2013
    24 Jun 2013
    Link to this post
    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.

    http://www.sitefinity.com/developer-network/forums/developing-with-sitefinity/securing-individual-files

    Regards,
    Nirav Golani
  2. Nirav
    Nirav avatar
    8 posts
    Registered:
    24 Jun 2013
    24 Jun 2013 in reply to Nirav
    Link to this post
    Hello Team,

    I followed below url:

    http://www.sitefinity.com/developer-network/forums/security/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. 
  3. Andrew
    Andrew avatar
    1 posts
    Registered:
    14 Apr 2015
    11 May 2015
    Link to this post
    ^ . 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!
  4. Sabrie Nedzhip
    Sabrie Nedzhip avatar
    534 posts
    Registered:
    05 Dec 2016
    14 May 2015
    Link to this post
    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
     
  5. David Arnold
    David Arnold avatar
    13 posts
    Registered:
    31 Jul 2009
    11 Nov in reply to Sabrie Nedzhip
    Link to this post

    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?

  6. Nidhi
    Nidhi avatar
    40 posts
    Registered:
    20 Jul 2010
    22 Nov
    Link to this post

    You can configure a front end login page url following these steps: http://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.

6 posts, 0 answered