Replacing NTFS permissions on all child objects

  • Thread starter Thread starter Roshan
  • Start date Start date
R

Roshan

Hi,

In NTFS all folders/container objects have an option called 'Replace
permission entries on all child objects with entries shown here that
apply to child objects'

As I understand this option replaces all explicitly configured and
inherited ACEs on all child objects of the folder with the ACEs of that
folder.

I don't see any option in the DirectorySecurity class to achieve this
functionality.
Does this mean that I must use Directory.GetFileSystemEntries() method
to traverse all the child objects, grandchild objects and so on and
explicilty set rights on them. This seems very ineffecient. Is there
any API to do this?

Any help is greatly appreciated

Thanks,
Roshan
 
AFAIK, there is no Windows API function or .NET Framework method that will
override explicit child ACEs in this way. Unless I've missed something,
you'll need to manually iterate over all child objects, removing any
non-inherited ACEs from each DACL in order to achieve the same effect.
 
Back
Top