<PackageReference Include="System.Security.AccessControl" Version="6.0.0-preview.4.21253.7" />

ObjectSecurity<T>

public abstract class ObjectSecurity<T> : NativeObjectSecurity where T : struct
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.
protected ObjectSecurity(bool isContainer, ResourceType resourceType)

Initializes a new instance of the ObjectSecurity`1 class.

protected ObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle safeHandle, AccessControlSections includeSections)

Initializes a new instance of the ObjectSecurity`1 class.

protected ObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle safeHandle, AccessControlSections includeSections, ExceptionFromErrorCode exceptionFromErrorCode, object exceptionContext)

Initializes a new instance of the ObjectSecurity`1 class.

protected ObjectSecurity(bool isContainer, ResourceType resourceType, string name, AccessControlSections includeSections)

Initializes a new instance of the ObjectSecurity`1 class.

protected ObjectSecurity(bool isContainer, ResourceType resourceType, string name, AccessControlSections includeSections, ExceptionFromErrorCode exceptionFromErrorCode, object exceptionContext)

Initializes a new instance of the ObjectSecurity`1 class.

public virtual void AddAccessRule(AccessRule<T> rule)

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

public virtual void AddAuditRule(AuditRule<T> rule)

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

public virtual bool RemoveAccessRule(AccessRule<T> rule)

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.

public virtual void RemoveAccessRuleAll(AccessRule<T> rule)

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.

public virtual void RemoveAccessRuleSpecific(AccessRule<T> rule)

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

public virtual bool RemoveAuditRule(AuditRule<T> rule)

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.

public virtual void RemoveAuditRuleAll(AuditRule<T> rule)

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.

public virtual void RemoveAuditRuleSpecific(AuditRule<T> rule)

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

public virtual void ResetAccessRule(AccessRule<T> rule)

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

public virtual void SetAccessRule(AccessRule<T> rule)

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.

public virtual void SetAuditRule(AuditRule<T> rule)

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.