ObjectSecurity<T> ObjectSecurity<T> ObjectSecurity<T> ObjectSecurity<T> Class

Definition

Provides the ability to control access to objects without direct manipulation of Access Control Lists (ACLs); also grants the ability to type-cast access rights.

generic <typename T>
 where T : value classpublic ref class ObjectSecurity abstract : System::Security::AccessControl::NativeObjectSecurity
public abstract class ObjectSecurity<T> : System.Security.AccessControl.NativeObjectSecurity where T : struct
type ObjectSecurity<'T (requires 'T : struct)> = class
    inherit NativeObjectSecurity
Public MustInherit Class ObjectSecurity(Of T)
Inherits NativeObjectSecurity

Type Parameters

T

The access rights for the object.

Inheritance
Derived

Remarks

Access rights (permissions) are type T, which you can type-cast to or from an int. For example, you can cast a FileSystemRights as the access rights type, and then use the instance normally. In contrast, ObjectSecurity always takes access rights of type int.

Constructors

ObjectSecurity<T>(Boolean, ResourceType) ObjectSecurity<T>(Boolean, ResourceType) ObjectSecurity<T>(Boolean, ResourceType) ObjectSecurity<T>(Boolean, ResourceType)

Initializes a new instance of the ObjectSecurity`1 class.

ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections) ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections) ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections) ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections)

Initializes a new instance of the ObjectSecurity`1 class.

ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object) ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object) ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object) ObjectSecurity<T>(Boolean, ResourceType, SafeHandle, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object)

Initializes a new instance of the ObjectSecurity`1 class.

ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections) ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections) ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections) ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections)

Initializes a new instance of the ObjectSecurity`1 class.

ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object) ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object) ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object) ObjectSecurity<T>(Boolean, ResourceType, String, AccessControlSections, NativeObjectSecurity+ExceptionFromErrorCode, Object)

Initializes a new instance of the ObjectSecurity`1 class.

Properties

AccessRightType AccessRightType AccessRightType AccessRightType

Gets the Type of the securable object associated with this ObjectSecurity`1 object.

AccessRulesModified AccessRulesModified AccessRulesModified AccessRulesModified

Gets or sets a Boolean value that specifies whether the access rules associated with this ObjectSecurity object have been modified.

(Inherited from ObjectSecurity)
AccessRuleType AccessRuleType AccessRuleType AccessRuleType

Gets the Type of the object associated with the access rules of this ObjectSecurity`1 object.

AreAccessRulesCanonical AreAccessRulesCanonical AreAccessRulesCanonical AreAccessRulesCanonical

Gets a Boolean value that specifies whether the access rules associated with this ObjectSecurity object are in canonical order.

(Inherited from ObjectSecurity)
AreAccessRulesProtected AreAccessRulesProtected AreAccessRulesProtected AreAccessRulesProtected

Gets a Boolean value that specifies whether the Discretionary Access Control List (DACL) associated with this ObjectSecurity object is protected.

(Inherited from ObjectSecurity)
AreAuditRulesCanonical AreAuditRulesCanonical AreAuditRulesCanonical AreAuditRulesCanonical

Gets a Boolean value that specifies whether the audit rules associated with this ObjectSecurity object are in canonical order.

(Inherited from ObjectSecurity)
AreAuditRulesProtected AreAuditRulesProtected AreAuditRulesProtected AreAuditRulesProtected

Gets a Boolean value that specifies whether the System Access Control List (SACL) associated with this ObjectSecurity object is protected.

(Inherited from ObjectSecurity)
AuditRulesModified AuditRulesModified AuditRulesModified AuditRulesModified

Gets or sets a Boolean value that specifies whether the audit rules associated with this ObjectSecurity object have been modified.

(Inherited from ObjectSecurity)
AuditRuleType AuditRuleType AuditRuleType AuditRuleType

Gets the Type object associated with the audit rules of this ObjectSecurity`1 object.

GroupModified GroupModified GroupModified GroupModified

Gets or sets a Boolean value that specifies whether the group associated with the securable object has been modified.

(Inherited from ObjectSecurity)
IsContainer IsContainer IsContainer IsContainer

Gets a Boolean value that specifies whether this ObjectSecurity object is a container object.

(Inherited from ObjectSecurity)
IsDS IsDS IsDS IsDS

Gets a Boolean value that specifies whether this ObjectSecurity object is a directory object.

(Inherited from ObjectSecurity)
OwnerModified OwnerModified OwnerModified OwnerModified

Gets or sets a Boolean value that specifies whether the owner of the securable object has been modified.

(Inherited from ObjectSecurity)

Methods

AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType) AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType) AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType) AccessRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AccessControlType)

Initializes a new instance of the ObjectAccessRule class that represents a new access control rule for the associated security object.

AddAccessRule(AccessRule) AddAccessRule(AccessRule) AddAccessRule(AccessRule) AddAccessRule(AccessRule)

Adds the specified access rule to the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
AddAccessRule(AccessRule<T>) AddAccessRule(AccessRule<T>) AddAccessRule(AccessRule<T>) AddAccessRule(AccessRule<T>)

Adds the specified access rule to the Discretionary Access Control List (DACL) associated with this ObjectSecurity`1 object.

AddAuditRule(AuditRule) AddAuditRule(AuditRule) AddAuditRule(AuditRule) AddAuditRule(AuditRule)

Adds the specified audit rule to the System Access Control List (SACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
AddAuditRule(AuditRule<T>) AddAuditRule(AuditRule<T>) AddAuditRule(AuditRule<T>) AddAuditRule(AuditRule<T>)

Adds the specified audit rule to the System Access Control List (SACL) associated with this ObjectSecurity`1 object.

AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags) AuditRuleFactory(IdentityReference, Int32, Boolean, InheritanceFlags, PropagationFlags, AuditFlags)

Initializes a new instance of the AuditRule class representing the specified audit rule for the specified user.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetAccessRules(Boolean, Boolean, Type) GetAccessRules(Boolean, Boolean, Type) GetAccessRules(Boolean, Boolean, Type) GetAccessRules(Boolean, Boolean, Type)

Gets a collection of the access rules associated with the specified security identifier.

(Inherited from CommonObjectSecurity)
GetAuditRules(Boolean, Boolean, Type) GetAuditRules(Boolean, Boolean, Type) GetAuditRules(Boolean, Boolean, Type) GetAuditRules(Boolean, Boolean, Type)

Gets a collection of the audit rules associated with the specified security identifier.

(Inherited from CommonObjectSecurity)
GetGroup(Type) GetGroup(Type) GetGroup(Type) GetGroup(Type)

Gets the primary group associated with the specified owner.

(Inherited from ObjectSecurity)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetOwner(Type) GetOwner(Type) GetOwner(Type) GetOwner(Type)

Gets the owner associated with the specified primary group.

(Inherited from ObjectSecurity)
GetSecurityDescriptorBinaryForm() GetSecurityDescriptorBinaryForm() GetSecurityDescriptorBinaryForm() GetSecurityDescriptorBinaryForm()

Returns an array of byte values that represents the security descriptor information for this ObjectSecurity object.

(Inherited from ObjectSecurity)
GetSecurityDescriptorSddlForm(AccessControlSections) GetSecurityDescriptorSddlForm(AccessControlSections) GetSecurityDescriptorSddlForm(AccessControlSections) GetSecurityDescriptorSddlForm(AccessControlSections)

Returns the Security Descriptor Definition Language (SDDL) representation of the specified sections of the security descriptor associated with this ObjectSecurity object.

(Inherited from ObjectSecurity)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ModifyAccess(AccessControlModification, AccessRule, Boolean) ModifyAccess(AccessControlModification, AccessRule, Boolean) ModifyAccess(AccessControlModification, AccessRule, Boolean) ModifyAccess(AccessControlModification, AccessRule, Boolean)

Applies the specified modification to the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
ModifyAccessRule(AccessControlModification, AccessRule, Boolean) ModifyAccessRule(AccessControlModification, AccessRule, Boolean) ModifyAccessRule(AccessControlModification, AccessRule, Boolean) ModifyAccessRule(AccessControlModification, AccessRule, Boolean)

Applies the specified modification to the Discretionary Access Control List (DACL) associated with this ObjectSecurity object.

(Inherited from ObjectSecurity)
ModifyAudit(AccessControlModification, AuditRule, Boolean) ModifyAudit(AccessControlModification, AuditRule, Boolean) ModifyAudit(AccessControlModification, AuditRule, Boolean) ModifyAudit(AccessControlModification, AuditRule, Boolean)

Applies the specified modification to the System Access Control List (SACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
ModifyAuditRule(AccessControlModification, AuditRule, Boolean) ModifyAuditRule(AccessControlModification, AuditRule, Boolean) ModifyAuditRule(AccessControlModification, AuditRule, Boolean) ModifyAuditRule(AccessControlModification, AuditRule, Boolean)

Applies the specified modification to the System Access Control List (SACL) associated with this ObjectSecurity object.

(Inherited from ObjectSecurity)
Persist(Boolean, String, AccessControlSections) Persist(Boolean, String, AccessControlSections) Persist(Boolean, String, AccessControlSections) Persist(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.

(Inherited from ObjectSecurity)
Persist(SafeHandle) Persist(SafeHandle) Persist(SafeHandle) Persist(SafeHandle)

Saves the security descriptor associated with this ObjectSecurity`1 object to permanent storage, using the specified handle.

Persist(SafeHandle, AccessControlSections) Persist(SafeHandle, AccessControlSections) Persist(SafeHandle, AccessControlSections) Persist(SafeHandle, AccessControlSections)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend.persist that the values of the includeSections parameters passed to the constructor and persist methods be identical.

(Inherited from NativeObjectSecurity)
Persist(SafeHandle, AccessControlSections, Object) Persist(SafeHandle, AccessControlSections, Object) Persist(SafeHandle, AccessControlSections, Object) Persist(SafeHandle, AccessControlSections, Object)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

(Inherited from NativeObjectSecurity)
Persist(String) Persist(String) Persist(String) Persist(String)

Saves the security descriptor associated with this ObjectSecurity`1 object to permanent storage, using the specified name.

Persist(String, AccessControlSections) Persist(String, AccessControlSections) Persist(String, AccessControlSections) Persist(String, AccessControlSections)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

(Inherited from NativeObjectSecurity)
Persist(String, AccessControlSections, Object) Persist(String, AccessControlSections, Object) Persist(String, AccessControlSections, Object) Persist(String, AccessControlSections, Object)

Saves the specified sections of the security descriptor associated with this NativeObjectSecurity object to permanent storage. We recommend that the values of the includeSections parameters passed to the constructor and persist methods be identical.

(Inherited from NativeObjectSecurity)
PurgeAccessRules(IdentityReference) PurgeAccessRules(IdentityReference) PurgeAccessRules(IdentityReference) PurgeAccessRules(IdentityReference)

Removes all access rules associated with the specified IdentityReference.

(Inherited from ObjectSecurity)
PurgeAuditRules(IdentityReference) PurgeAuditRules(IdentityReference) PurgeAuditRules(IdentityReference) PurgeAuditRules(IdentityReference)

Removes all audit rules associated with the specified IdentityReference.

(Inherited from ObjectSecurity)
ReadLock() ReadLock() ReadLock() ReadLock()

Locks this ObjectSecurity object for read access.

(Inherited from ObjectSecurity)
ReadUnlock() ReadUnlock() ReadUnlock() ReadUnlock()

Unlocks this ObjectSecurity object for read access.

(Inherited from ObjectSecurity)
RemoveAccessRule(AccessRule) RemoveAccessRule(AccessRule) RemoveAccessRule(AccessRule) RemoveAccessRule(AccessRule)

Removes access rules that contain the same security identifier and access mask as the specified access rule from the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
RemoveAccessRule(AccessRule<T>) RemoveAccessRule(AccessRule<T>) RemoveAccessRule(AccessRule<T>) RemoveAccessRule(AccessRule<T>)

Removes access rules that contain the same security identifier and access mask as the specified access rule from the Discretionary Access Control List (DACL) associated with this ObjectSecurity`1 object.

RemoveAccessRuleAll(AccessRule) RemoveAccessRuleAll(AccessRule) RemoveAccessRuleAll(AccessRule) RemoveAccessRuleAll(AccessRule)

Removes all access rules that have the same security identifier as the specified access rule from the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
RemoveAccessRuleAll(AccessRule<T>) RemoveAccessRuleAll(AccessRule<T>) RemoveAccessRuleAll(AccessRule<T>) RemoveAccessRuleAll(AccessRule<T>)

Removes all access rules that have the same security identifier as the specified access rule from the Discretionary Access Control List (DACL) associated with this ObjectSecurity`1 object.

RemoveAccessRuleSpecific(AccessRule) RemoveAccessRuleSpecific(AccessRule) RemoveAccessRuleSpecific(AccessRule) RemoveAccessRuleSpecific(AccessRule)

Removes all access rules that exactly match the specified access rule from the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
RemoveAccessRuleSpecific(AccessRule<T>) RemoveAccessRuleSpecific(AccessRule<T>) RemoveAccessRuleSpecific(AccessRule<T>) RemoveAccessRuleSpecific(AccessRule<T>)

Removes all access rules that exactly match the specified access rule from the Discretionary Access Control List (DACL) associated with this ObjectSecurity`1 object

RemoveAuditRule(AuditRule) RemoveAuditRule(AuditRule) RemoveAuditRule(AuditRule) RemoveAuditRule(AuditRule)

Removes audit rules that contain the same security identifier and access mask as the specified audit rule from the System Access Control List (SACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
RemoveAuditRule(AuditRule<T>) RemoveAuditRule(AuditRule<T>) RemoveAuditRule(AuditRule<T>) RemoveAuditRule(AuditRule<T>)

Removes audit rules that contain the same security identifier and access mask as the specified audit rule from the System Access Control List (SACL) associated with this ObjectSecurity`1 object.

RemoveAuditRuleAll(AuditRule) RemoveAuditRuleAll(AuditRule) RemoveAuditRuleAll(AuditRule) RemoveAuditRuleAll(AuditRule)

Removes all audit rules that have the same security identifier as the specified audit rule from the System Access Control List (SACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
RemoveAuditRuleAll(AuditRule<T>) RemoveAuditRuleAll(AuditRule<T>) RemoveAuditRuleAll(AuditRule<T>) RemoveAuditRuleAll(AuditRule<T>)

Removes all audit rules that have the same security identifier as the specified audit rule from the System Access Control List (SACL) associated with this ObjectSecurity`1 object.

RemoveAuditRuleSpecific(AuditRule) RemoveAuditRuleSpecific(AuditRule) RemoveAuditRuleSpecific(AuditRule) RemoveAuditRuleSpecific(AuditRule)

Removes all audit rules that exactly match the specified audit rule from the System Access Control List (SACL) associated with this CommonObjectSecurity object.

(Inherited from CommonObjectSecurity)
RemoveAuditRuleSpecific(AuditRule<T>) RemoveAuditRuleSpecific(AuditRule<T>) RemoveAuditRuleSpecific(AuditRule<T>) RemoveAuditRuleSpecific(AuditRule<T>)

Removes all audit rules that exactly match the specified audit rule from the System Access Control List (SACL) associated with this ObjectSecurity`1 object

ResetAccessRule(AccessRule) ResetAccessRule(AccessRule) ResetAccessRule(AccessRule) ResetAccessRule(AccessRule)

Removes all access rules in the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object and then adds the specified access rule.

(Inherited from CommonObjectSecurity)
ResetAccessRule(AccessRule<T>) ResetAccessRule(AccessRule<T>) ResetAccessRule(AccessRule<T>) ResetAccessRule(AccessRule<T>)

Removes all access rules in the Discretionary Access Control List (DACL) associated with this ObjectSecurity`1 object and then adds the specified access rule.

SetAccessRule(AccessRule) SetAccessRule(AccessRule) SetAccessRule(AccessRule) SetAccessRule(AccessRule)

Removes all access rules that contain the same security identifier and qualifier as the specified access rule in the Discretionary Access Control List (DACL) associated with this CommonObjectSecurity object and then adds the specified access rule.

(Inherited from CommonObjectSecurity)
SetAccessRule(AccessRule<T>) SetAccessRule(AccessRule<T>) SetAccessRule(AccessRule<T>) SetAccessRule(AccessRule<T>)

Removes all access rules that contain the same security identifier and qualifier as the specified access rule in the Discretionary Access Control List (DACL) associated with this ObjectSecurity`1 object and then adds the specified access rule.

SetAccessRuleProtection(Boolean, Boolean) SetAccessRuleProtection(Boolean, Boolean) SetAccessRuleProtection(Boolean, Boolean) SetAccessRuleProtection(Boolean, Boolean)

Sets or removes protection of the access rules associated with this ObjectSecurity object. Protected access rules cannot be modified by parent objects through inheritance.

(Inherited from ObjectSecurity)
SetAuditRule(AuditRule) SetAuditRule(AuditRule) SetAuditRule(AuditRule) SetAuditRule(AuditRule)

Removes all audit rules that contain the same security identifier and qualifier as the specified audit rule in the System Access Control List (SACL) associated with this CommonObjectSecurity object and then adds the specified audit rule.

(Inherited from CommonObjectSecurity)
SetAuditRule(AuditRule<T>) SetAuditRule(AuditRule<T>) SetAuditRule(AuditRule<T>) SetAuditRule(AuditRule<T>)

Removes all audit rules that contain the same security identifier and qualifier as the specified audit rule in the System Access Control List (SACL) associated with this ObjectSecurity`1 object and then adds the specified audit rule.

SetAuditRuleProtection(Boolean, Boolean) SetAuditRuleProtection(Boolean, Boolean) SetAuditRuleProtection(Boolean, Boolean) SetAuditRuleProtection(Boolean, Boolean)

Sets or removes protection of the audit rules associated with this ObjectSecurity object. Protected audit rules cannot be modified by parent objects through inheritance.

(Inherited from ObjectSecurity)
SetGroup(IdentityReference) SetGroup(IdentityReference) SetGroup(IdentityReference) SetGroup(IdentityReference)

Sets the primary group for the security descriptor associated with this ObjectSecurity object.

(Inherited from ObjectSecurity)
SetOwner(IdentityReference) SetOwner(IdentityReference) SetOwner(IdentityReference) SetOwner(IdentityReference)

Sets the owner for the security descriptor associated with this ObjectSecurity object.

(Inherited from ObjectSecurity)
SetSecurityDescriptorBinaryForm(Byte[]) SetSecurityDescriptorBinaryForm(Byte[]) SetSecurityDescriptorBinaryForm(Byte[]) SetSecurityDescriptorBinaryForm(Byte[])

Sets the security descriptor for this ObjectSecurity object from the specified array of byte values.

(Inherited from ObjectSecurity)
SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections) SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections) SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections) SetSecurityDescriptorBinaryForm(Byte[], AccessControlSections)

Sets the specified sections of the security descriptor for this ObjectSecurity object from the specified array of byte values.

(Inherited from ObjectSecurity)
SetSecurityDescriptorSddlForm(String) SetSecurityDescriptorSddlForm(String) SetSecurityDescriptorSddlForm(String) SetSecurityDescriptorSddlForm(String)

Sets the security descriptor for this ObjectSecurity object from the specified Security Descriptor Definition Language (SDDL) string.

(Inherited from ObjectSecurity)
SetSecurityDescriptorSddlForm(String, AccessControlSections) SetSecurityDescriptorSddlForm(String, AccessControlSections) SetSecurityDescriptorSddlForm(String, AccessControlSections) SetSecurityDescriptorSddlForm(String, AccessControlSections)

Sets the specified sections of the security descriptor for this ObjectSecurity object from the specified Security Descriptor Definition Language (SDDL) string.

(Inherited from ObjectSecurity)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
WriteLock() WriteLock() WriteLock() WriteLock()

Locks this ObjectSecurity object for write access.

(Inherited from ObjectSecurity)
WriteUnlock() WriteUnlock() WriteUnlock() WriteUnlock()

Unlocks this ObjectSecurity object for write access.

(Inherited from ObjectSecurity)

Applies to