Password protect download list or download link?

Posted by Community Admin on 03-Aug-2018 03:20

Password protect download list or download link?

All Replies

Posted by Community Admin on 07-Oct-2011 00:00
Hi, rather then permissions, is it possible to have a password protected download list or downlaod link?
Posted by Community Admin on 11-Oct-2011 00:00
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
Posted by Community Admin on 10-Nov-2011 00:00
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?
Posted by Community Admin on 15-Nov-2011 00:00
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
This thread is closed