
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
990
|
Chapter 17: Security
the Access Control Entries (ACE) that make up the list of security rules within a
DACL.
System objects other than just the
File class and RegistryKey object allow security
privileges to be queried. Table 17-1 lists all the .NET Framework classes that return a
security object type and what that type is. In addition, the rule-object type that is
contained in the security object is also listed.
The abstraction of a system object’s DACL through the
*Security objects and the
abstraction of a DACL’s ACE through the
*AccessRule objects allows easy access to
the security privileges of that system object. In previous versions of the .NET Frame-
work, these DACLs and their ACEs would have been accessible only in unmanaged
code. With the latest .NET Framework, you now have access to view and program
these objects.
See Also
See Recipe 17.14; see the “System.IO.File.GetAccessControl Method,” “System.
Security.AccessControl.FileSecurity Class,” “Microsoft.Win32.RegistryKey.GetAc-
cessControl Method,” and “System.Security.AccessControl.RegistrySecurity Class”
topics in the MSDN documentation.
17.14 Granting/Revoking Access to a File
or Registry Key
Problem
You need to change the security privileges of either a file or registry key
programmatically.
Table 17-1. List of all *Security and ...