Try our conversational search powered by Generative AI!

Create UnifiedDirectory with ACL



Got a problem, i´m trying to create a directory and set specific access rights to that folder. Can´t get it to work properly. I want to add all rights except administer to a specific user and everything I tired returns an error or just a single accessright.
Anyone got any ideas?

This is my latest attemt to accomplish this:

string vPath = "/Documents/Private"; if (!HostingEnvironment.VirtualPathProvider.DirectoryExists(vPath)) { UnifiedDirectory ud = UnifiedDirectory.CreateDirectory(vPath); UnifiedDirectory u = HostingEnvironment.VirtualPathProvider.GetDirectory(vPath) as UnifiedDirectory; u.ACL.IsInherited = false; RawACE raw = new RawACE(); raw.Access = u.ACL.QueryAccess(AccessLevel.Delete & AccessLevel.Create & AccessLevel.Read & AccessLevel.Edit); raw.Name = "PrivateUser"; u.ACL.Add(new AccessControlEntry(raw)); u.ACL.Save(); }
Sep 26, 2008 8:45


When i need to add rights to a page i do it like this:

AccessControlEntry ent = new AccessControlEntry("PrivateUser", AccessLevel.Delete | AccessLevel.Create | AccessLevel.Read | AccessLevel.Edit);

 Maybe it will work on your folder as well?

 -Kjetil Simensen

Sep 26, 2008 9:27

That did it.

Thank you very much. Saved my day


Sep 26, 2008 9:52
* 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.