Iron Python FileSystemAccessRule Constructor Error (No flags can be set)
===

First, the code:

    sec = System.Security.AccessControl.FileSecurity()
    flag = System.Security.AccessControl.InheritanceFlags.ObjectInherit|System.Security.AccessControl.InheritanceFlags.ContainerInherit
    flag2 = System.Security.AccessControl.PropagationFlags.None
    user = System.Security.Principal.NTAccount("DOMAIN", nameuser[0].Properties["samAccountName"][0]) # getting name from AD (not important)
    control = System.Security.AccessControl.FileSystemRights.FullControl
    accesstype = System.Security.AccessControl.AccessControlType.Allow
    
    # heres the error cause
    sec.AddAccessRule(System.Security.AccessControl.FileSystemAccessRule(user,control, flag1, flag2, accesstype))
    # System.IO.File.SetAccessControl(path+"\\"+folder,sec) - it never reaches here

Then the error:

    ValueError: No flags can be set.
    Parameter name: inheritanceFlags

Here is the link to the .NET documentation on the constructor: [FileSystemAccessRule][1]

Any ideas? It doesn't completely break functionality, but if I can set inheritance, I don't have to walk down the whole directory tree of 30,000+ folders and 500,000+ files (I closed the properties dialog because I got tired of watching).

I think I also tried subclassing System.Security.AccessControl but it was sealed. I really don't know what else to add... I might just have to write it in C# to get this done, but I'd prefer to figure out the problem and use Python.


  [1]: http://msdn.microsoft.com/en-us/library/ms147785