Need some assistance in setting up a widget to show the libraries and documents in TreeView similar to this link below, is this possible?
LibrariesManager manager =
var albums = manager.GetDocumentLibraries();
var data =
var children = manager.GetAllFolders(item);
var model =
model.Title = item.Title.ToString();
model.Id = item.Id;
model.ParentId = (item.ParentId ==
var modelChild =
modelChild.Title = child.Title.ToString();
modelChild.MediaUrl = child.Title.ToString();
modelChild.Id = child.Id;
modelChild.ParentId = child.ParentId;
List<LibraryTreeModel> models =
// For folders
IQueryable<Telerik.Sitefinity.Libraries.Model.Document> docsFolders = manager.GetDocuments()
.Where(img => img.FolderId == item.Id && img.Status == ContentLifecycleStatus.Live);
// If folder is actually a Library
IQueryable<Telerik.Sitefinity.Libraries.Model.Document> docsLibraries = manager.GetDocuments()
.Where(img => img.Parent !=
&& img.Parent.Id == item.Id && img.FolderId ==
&& img.Status == ContentLifecycleStatus.Live);
IQueryable<Telerik.Sitefinity.Libraries.Model.Document> allDocs = docsFolders.Concat(docsLibraries);
modelChild.Title = file.Title.ToString();
modelChild.Id = file.Id;
modelChild.ParentId = item.Id;
modelChild.MediaUrl = file.MediaUrl;
IEnumerable<LibraryTreeModel> ds = models.Concat(data);
TreeView.DataSource = data;
<%@ Control Language="C#" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
href='<%# DataBinder.Eval(Container.DataItem, "MediaUrl") %>'><%# DataBinder.Eval(Container.DataItem, "Title") %></
Two questions. Is there a way to show only the libraries the logged in user has access to? Also when I click on the library itself it takes me to back to the homepage, is that normal? Once again thanks for your assistance with this!
That is correct. The files that a user does not have access to it does not let me download them it gives me the page in the image attached. What I am asking is if its possible to not show those libraries at all when the user logs in and just show the libraries that the user has access to.
I already have that setting applied to filter queries by view permission but when I login with a user who doesn't have access to a specific album i can still see it and its content. However, it does not let me download the content, what I want is to not show the library the the user does not have access to at all in the TreeView.
The permission settings for "Documents & Files" is set to "Everyone" but the actual individual libraries are set to only "View document library" and "View document" based on a specific role which is what I want. In the regular downloads list widget it is set like this and it shows me only the documents of the library that the user role has access to. There is no way to show the parent library and sub library that documents are in using the download list widget is there? something similar to how "Documents and Files" is shown on the back-end because if there is that would be great seeing as permission wise it works wonderfully.