November Happy Hour will be moved to Thursday December 5th.

Bug in QueryDistinctAccess on folders?

Vote:
 

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

Br

Per Nergård

try

{

//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
Vote:
 

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

 -Kjetil Simensen

#27717
Edited, Feb 09, 2009 10:42
Vote:
 

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

 Thanks!

 Per

#27911
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.