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

Forums / General Discussions / Password protect download list or download link?

Password protect download list or download link?

4 posts, 0 answered
  1. Charles
    Charles avatar
    36 posts
    Registered:
    18 Apr 2011
    07 Oct 2011
    Link to this post
    Hi, rather then permissions, is it possible to have a password protected download list or downlaod link?
  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Sep 2017
    11 Oct 2011
    Link to this post
    Hello Charles,

    There is a possible solution to this scenario that can be achieved using a combination of widgets and permissions.
    Place a download list widget that lists the documents that should be downloaded. Modify the widget template for download list. You should remove the url to the document and use a simple link that will redirect the user to a target page(this will redirect the user when clicking all of the listed documents ).
    On the page where the user will be redirected you can have a login widget(login widget can also redirect to a specific page by specifying the page in DestinationPageUrl textfield of the widget) and some instructions that the user should be logged in to download.
    Then you place another download list widget on this page or another page or the same page where the login is.
    Apply permissions to the download list widget so it can be viewed only by certain roles, users, or authenticated.
    This is the approach using the out of the box Sitefinity widgets.

    All the best,
    Stanislav Velikov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. Webteam
    Webteam avatar
    28 posts
    Registered:
    30 Nov 2009
    10 Nov 2011
    Link to this post
    We have a similar question to this one.  We have a download list where some of the items are open to everyone to view whereas other items are gated (via permissions).  We still want users who don't have permission to view the document to see the document title/description in the download list, but when they click on the item we want it to go to a registration page instead of downloading the document. 

    Is it possible to achieve this functionality via editing the template or will we need to override some of the download list control methods?
  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    18 Sep 2017
    15 Nov 2011
    Link to this post
    Hello Webteam,

    To avoid mapping templates I suggest this approach. Add this to the widget template for download list
    //Registers above
    <script language="C#" type="text/C#" runat="server">
       protected void Page_Load(object sender, EventArgs e)
            {
                //check if a user is in role
                if (Telerik.Sitefinity.Security.SecurityManager.GetCurrentUser().IsInRole("Administrators"))
                {
                  //I used this for sample
     
                    this.Label1.Text = "I am Admin";
                }
                else
                {
                    this.Label1.Text = "I am not recognized";
                }
     
            }
    </script>
     
     
    <sitefinity:ResourceLinks id="resourcesLinks2" runat="server" UseEmbeddedThemes="true" Theme="Default">
      <sitefinity:ResourceFile Name="Telerik.Sitefinity.Resources.Themes.Basic.Styles.icons.css" Static="true" />
    </sitefinity:ResourceLinks>
    <sf:BrowseAndEditToolbar ID="browseAndEditToolbar" runat="server" Mode="Edit"></sf:BrowseAndEditToolbar>
    <div id="itemsContainer" runat="server">
     
    <asp:Label runat="server" Text="rad" ID="Label1"></asp:Label>


    All the best,
    Stanislav Velikov
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
4 posts, 0 answered