AI OnAI Off
Hello again,
I found out how to. The key was to use the FilterAccess class.
var fa = new FilterAccess(); var folders = repository.GetChildren<IContent>(folder.ContentLink) .Where(a => !fa.ShouldFilter(a)) .ToList();
BR
Patrik
Hey guys
I want to display ContentFolders and MediaData and filter it for the current user.
This line gives me the unfiltered content (which is of no use to me):
var folders = repository.GetChildren(folder.ContentLink).ToList(); // gives me 2 hits
but when I try to filter it, I get zero hits:
var filteredFolders = EPiServer.Filters.FilterForVisitor.Filter(foldersLevel1); // gives zero hits
Even when logged in as web admin I get zero hits. The access rights are correct.
Help!
BR
Patrik