Anders Hattestad
Dec 18, 2012
  2604
(1 votes)

Virtual role: Creator in VPP not working

If you set up a Versioning VPP fil system in EpiServer 6R2 the role creator will not work. This is becasue it’s not in the ACL.

There is a fix for it, but it will only work for the creator of the folder. You need to use this code as your VPP provider instead of the orgianal VirtualPathVersioningProvider.

Code Snippet
  1. public class VirtualPathVersioningProviderOwn : EPiServer.Web.Hosting.VirtualPathVersioningProvider
  2. {
  3.     public VirtualPathVersioningProviderOwn(string name, NameValueCollection configParameters)
  4.         : base(name, configParameters) { }
  5.     public override System.Web.Hosting.VirtualDirectory GetDirectory(string virtualPath)
  6.     {
  7.         var cat = base.GetDirectory(virtualPath);
  8.         var cat2 = cat as VersioningDirectory;
  9.         if (cat2 != null)
  10.         {
  11.             if (cat2.ACL.IsReadOnly)
  12.                 return cat;
  13.             if (cat2.DirectoryHandler != null && cat2.DirectoryHandler.InternalItem != null)
  14.                 cat2.ACL.Creator = cat2.DirectoryHandler.InternalItem.CreatedBy;
  15.         }
  16.  
  17.         return cat;
  18.     }
  19. }
Dec 18, 2012

Comments

Please login to comment.
Latest blogs
SNAT - Azure App Service socket exhaustion

Did you know that using HttpClient within a using statement can cause SNAT (Source Network Address Translation) port exhaustion? This can lead to...

Oleksandr Zvieriev | Sep 9, 2024

Micro front-ends are massive for Optimizely One

Optimizely products have evolved. Their new generation of products changes the game.

Mark Everard | Sep 9, 2024 | Syndicated blog

Micro front-ends are massive for Optimizely One

Optimizely products have evolved. Their new generation of products changes the game.   A multi-year journey for Optimizely. They have engineered...

Mark Everard | Sep 9, 2024 | Syndicated blog

Handling Nynorsk and Bokmål in Optimizely CMS

Warning: Blog post about Norwegian language handling (but might be applicable to other languages and/or use cases). Optimizely have flexible and...

Haakon Peder Haugsten | Sep 5, 2024