VB.NET app is setting restricted file permissions on a directory, which is incorrectly restricting user created files in the same directory
===

My VB.NET application builds a tree of directories with restricted access.

The access should be that a normal user can not delete or rename the existing tree.  But the user can add new files/folders anywhere in the tree.  A user created file/folder should be fully modifiable by any user.

The problem I'm having is getting access set so that files/folders created by the app can't be changed, but files/folders created by users can be changed by any user.

What is currently happening, is the files/folders made by the application behave correctly.  But when a user creates their own file/folder, that file's/folder's permissions only list the current user.  So other users (or even system admins that exist of the application created files/folders) can't view or modify this user created file/folder.

<br />

<b>Current Code:</b>  (when a user creates a file/folder themselves, this code doesn't give access to UserGroup or AdminGroup, only the user who just created the file/folder)

    FolderAcl.AddAccessRule(New FileSystemAccessRule(UserGroup,
                            FileSystemRights.ReadAndExecute,
                            InheritanceFlags.None, PropagationFlags.None,
                            AccessControlType.Allow))
    FolderAcl.AddAccessRule(New FileSystemAccessRule(UserGroup,
                            FileSystemRights.Write,
                            InheritanceFlags.None, PropagationFlags.None,
                            AccessControlType.Allow))

    FolderAcl.AddAccessRule(New FileSystemAccessRule(AdminGroup,
                            FileSystemRights.FullControl,
                            InheritanceFlags.None, PropagationFlags.None,
                            AccessControlType.Allow))

    FolderAcl.SetAccessRuleProtection(True, False)

<br />

<b>Another Attempt:</b>  (when a user create a file/folder themselves, this code gives access to UserGroup and AdminGroup, but doesn't give access to the user.  The user is in UserGroup, but UserGroup doesn't have delete or modify privileges so if the user creates a file/folder they can't even name it.)

    ' same code as above except...
    InheritanceFlags.None ---> InheritanceFlags.Container or InheritanceFlags.Object

<br />

I've tried other combinations of the InheritanceFlags and PropagationFlags, but no luck yet.

Any ideas?
<br />
Thanks,
Mike
