Try our conversational search powered by Generative AI!

Bug in QueryDistinctAccess on folders?


One of out testers stumbled on an error which I think must be a bug in EPiServer.

 We are using the new LinkCollection property but has made our own presentations of the links. One of the things we do is to check if the group "Everyone" has read access or not, so we can present a icon the "flags" that this is something not everyone has the right to see even if you as the logged in user can.

The problem is that if you create a folder in the file manager wich contains spaces
the QueryDistinct access fails due to that the GetDirectory returns null.

See the code below


Per Nergård



//Try to get the directory for the current file

UnifiedDirectory directory = HostingEnvironment.VirtualPathProvider.GetDirectory(path) as UnifiedDirectory;

   //Has the group everyone read access?

return directory.ACL.QueryDistinctAccess(PrincipalInfo.AnonymousPrincipal, AccessLevel.Read);


catch (UnauthorizedAccessException ex)


// The current user doesn't have access to the folder. Hence some restrictions apply.

return false;


Feb 09, 2009 10:10

have you tired using url encoding/decoding on the path?

 -Kjetil Simensen

Edited, Feb 09, 2009 10:42

Hmm why didn't I think of that... UrlEncoding did the trick.



Feb 12, 2009 16:35
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.