Replacing NTFS permissions on all child objects

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
 
N

Nicole Calinoiu

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top