System.Security.AccessControl.FileSecurity

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Travis Sharpe

    #1

    System.Security.AccessControl.FileSecurity

    The .NET 2.0 framework has provided some new classes to assist in
    manipulating NTFS File Permissions. Compared to the previous methods of
    directly editing/ordering DACL's, this is much easier.

    There are a few things that I'm finding difficult to do with the new
    classes though and they deal with inheritance.

    Let's say that we have a folder named "Test" that has all files and
    folders underneath configured to inherit permissions from Test. We go
    to a file directly underneath "Test" and tell it to stop inheriting
    permissions. The permissions of this file now only include those that
    were explicitly defined on the file.

    With the new classes in .NET 2.0, how do you force the file to
    re-inherit the parents permissions and additionally keep the explicitly
    defined permissions on the file?

    Alternatively, going the opposite direction, how would you go about
    starting at a directory and resetting all files and folders underneath
    that directory to inherit permissions, but additionally keep any
    explicitly defined permissions on the files?

    Sorry, kind of long-winded.

    Thanks.
Working...