This documentation is archived and is not being maintained.

ObjectSecurity.Persist Method (Boolean, String, AccessControlSections)

Saves the specified sections of the security descriptor associated with this ObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical. For more information, see Remarks.

Namespace:  System.Security.AccessControl
Assembly:  mscorlib (in mscorlib.dll)

protected virtual void Persist(
	bool enableOwnershipPrivilege,
	string name,
	AccessControlSections includeSections


Type: System.Boolean
true to enable the privilege that allows the caller to take ownership of the object.
Type: System.String
The name used to retrieve the persisted information.
Type: System.Security.AccessControl.AccessControlSections
One of the AccessControlSections enumeration values that specifies the sections of the security descriptor (access rules, audit rules, owner, primary group) of the securable object to save.

When persisting a ObjectSecurity object, if the value of the includeSections parameter passed to the Persist() method is not identical to the value of the includeSections parameter passed to the constructor used to create that ObjectSecurity object, sections of the persisted ObjectSecurity object can contain unpredictable values. For example, if a constructor is called with an includeSections value of Access, and later a Persist() method is called on that object with an includeSections value of All, the resulting persisted ObjectSecurity object will contain unpredictable values for its audit rules, group, and owner.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.