C# Programming
11-07-2009, 03:40 PM
I am looking for a way using C# to retrieve the "Apply Onto" value viewed when looking at the advanced properties for a directory.
...
// get security for directory
AuthorizationRuleCollection arc = security.GetAccessRules(true, true, SECURITY_IDENTIFIER_TYPE);
foreach (FileSystemAccessRule fsar in arc) {
String type = fsar.AccessControlType.ToString();
...
}
I am trying to progromatically figure out which "Permissions Group" ( Full Control, Modify, Read and Execute a file and or directory is assigned.
List folder contents, Read, Write) is assigned.. I don't see anything stored on the FileSystemAccessRule to give me the "Apply Onto" field. Is there another object I have to use?
Read and Execute AND List folder contents have the same exact rights, but differ by the "Apply Onto" field.
List folder contents the Assigned onto field is : "This folder, subfolder and files"
Read and Execute the Assigned onto field is : "This folder and subfolders"
Is there another way to figure out this problem?
Any help would be appreciated.
Thanks.
...
// get security for directory
AuthorizationRuleCollection arc = security.GetAccessRules(true, true, SECURITY_IDENTIFIER_TYPE);
foreach (FileSystemAccessRule fsar in arc) {
String type = fsar.AccessControlType.ToString();
...
}
I am trying to progromatically figure out which "Permissions Group" ( Full Control, Modify, Read and Execute a file and or directory is assigned.
List folder contents, Read, Write) is assigned.. I don't see anything stored on the FileSystemAccessRule to give me the "Apply Onto" field. Is there another object I have to use?
Read and Execute AND List folder contents have the same exact rights, but differ by the "Apply Onto" field.
List folder contents the Assigned onto field is : "This folder, subfolder and files"
Read and Execute the Assigned onto field is : "This folder and subfolders"
Is there another way to figure out this problem?
Any help would be appreciated.
Thanks.