Bug in QueryDistinctAccess on folders?

Per Nergård
Member since: 2007

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;


#27713 Feb 09, 2009 10:10

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

     -Kjetil Simensen

    #27717 Edited, Feb 09, 2009 10:42
  • Per Nergård
    Member since: 2007

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



    #27911 Feb 12, 2009 16:35