Note: This method is new in the .NET Framework version 2.0.
Sets or removes protection of the audit rules associated with this
ObjectSecurity object. Protected audit rules cannot be modified by parent objects through inheritance.
Namespace: System.Security.AccessControl
Assembly: mscorlib (in mscorlib.dll)
Visual Basic (Declaration)
Public Sub SetAuditRuleProtection ( _
isProtected As Boolean, _
preserveInheritance As Boolean _
)
Dim instance As ObjectSecurity
Dim isProtected As Boolean
Dim preserveInheritance As Boolean
instance.SetAuditRuleProtection(isProtected, preserveInheritance)
public void SetAuditRuleProtection (
bool isProtected,
bool preserveInheritance
)
public:
void SetAuditRuleProtection (
bool isProtected,
bool preserveInheritance
)
public void SetAuditRuleProtection (
boolean isProtected,
boolean preserveInheritance
)
public function SetAuditRuleProtection (
isProtected : boolean,
preserveInheritance : boolean
)
Parameters
- isProtected
true to protect the audit rules associated with this ObjectSecurity object from inheritance; false to allow inheritance.
- preserveInheritance
true to preserve inherited audit rules; false to remove inherited audit rules. This parameter is ignored if isProtected is false.
| Exception type | Condition |
|---|
>InvalidOperatorException | This method attempts to remove inherited rules from a non-canonical System Access Control List (SACL). |
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.
.NET Framework
Supported in: 2.0