Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Security.​AccessControl.​DiscretionaryAcl

Assembly: System.Security.AccessControl

Inheritance: object → GenericAclCommonAcl → DiscretionaryAcl

Implemented Interfaces

Represents a Discretionary Access Control List (DACL).

Properties

public int
BinaryLength
Gets the length, in bytes, of the binary representation of the current <see cref="T:System.Security.AccessControl.CommonAcl" /> object. This length should be used before marshaling the access control list (ACL) into a binary array by using the <see cref="M:System.Security.AccessControl.CommonAcl.GetBinaryForm(System.Byte[],System.Int32)" /> method.
public int
Count
Gets the number of access control entries (ACEs) in the current <see cref="T:System.Security.AccessControl.CommonAcl" /> object.
public bool
IsCanonical
Gets a Boolean value that specifies whether the access control entries (ACEs) in the current <see cref="T:System.Security.AccessControl.CommonAcl" /> object are in canonical order.
public bool
IsContainer
Sets whether the <see cref="T:System.Security.AccessControl.CommonAcl" /> object is a container.
public bool
IsDS
Sets whether the current <see cref="T:System.Security.AccessControl.CommonAcl" /> object is a directory object access control list (ACL).
public GenericAce
Item
public byte
Revision
Gets the revision level of the <see cref="T:System.Security.AccessControl.CommonAcl" /> .
public bool
IsSynchronized
This property is always set to <see langword="false" /> . It is implemented only because it is required for the implementation of the <see cref="T:System.Collections.ICollection" /> interface.
public object
SyncRoot
This property always returns <see langword="null" /> . It is implemented only because it is required for the implementation of the <see cref="T:System.Collections.ICollection" /> interface.

Methods

public void
AddAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
Adds an Access Control Entry (ACE) with the specified settings to the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object.
accessType The type of access control (allow or deny) to add.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to add an ACE.
accessMask The access rule for the new ACE.
inheritanceFlags Flags that specify the inheritance properties of the new ACE.
propagationFlags Flags that specify the inheritance propagation properties for the new ACE.
public void
AddAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
Adds an Access Control Entry (ACE) with the specified settings to the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object. Use this method for directory object Access Control Lists (ACLs) when specifying the object type or the inherited object type for the new ACE.
accessType The type of access control (allow or deny) to add.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to add an ACE.
accessMask The access rule for the new ACE.
inheritanceFlags Flags that specify the inheritance properties of the new ACE.
propagationFlags Flags that specify the inheritance propagation properties for the new ACE.
objectFlags Flags that specify if the <paramref name="objectType" /> and <paramref name="inheritedObjectType" /> parameters contain non- <see langword="null" /> values.
objectType The identity of the class of objects to which the new ACE applies.
inheritedObjectType The identity of the class of child objects which can inherit the new ACE.
public void
AddAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, ObjectAccessRule rule)
Adds an Access Control Entry (ACE) with the specified settings to the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object.
accessType The type of access control (allow or deny) to add.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to add an ACE.
rule The <see cref="T:System.Security.AccessControl.ObjectAccessRule" /> for the new access.
public bool
RemoveAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
Removes the specified access control rule from the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object.
Returns <see langword="true" /> if this method successfully removes the specified access; otherwise, <see langword="false" /> .
accessType The type of access control (allow or deny) to remove.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to remove an access control rule.
accessMask The access mask for the rule to be removed.
inheritanceFlags Flags that specify the inheritance properties of the rule to be removed.
propagationFlags Flags that specify the inheritance propagation properties for the rule to be removed.
public bool
RemoveAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
Removes the specified access control rule from the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object. Use this method for directory object Access Control Lists (ACLs) when specifying the object type or the inherited object type.
Returns <see langword="true" /> if this method successfully removes the specified access; otherwise, <see langword="false" /> .
accessType The type of access control (allow or deny) to remove.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to remove an access control rule.
accessMask The access mask for the access control rule to be removed.
inheritanceFlags Flags that specify the inheritance properties of the access control rule to be removed.
propagationFlags Flags that specify the inheritance propagation properties for the access control rule to be removed.
objectFlags Flags that specify if the <paramref name="objectType" /> and <paramref name="inheritedObjectType" /> parameters contain non- <see langword="null" /> values.
objectType The identity of the class of objects to which the removed access control rule applies.
inheritedObjectType The identity of the class of child objects which can inherit the removed access control rule.
public bool
RemoveAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, ObjectAccessRule rule)
Removes the specified access control rule from the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object.
Returns Returns <see cref="T:System.Boolean" /> .
accessType The type of access control (allow or deny) to remove.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to remove an access control rule.
rule The <see cref="T:System.Security.AccessControl.ObjectAccessRule" /> for which to remove access.
public void
RemoveAccessSpecific​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
Removes the specified Access Control Entry (ACE) from the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object.
accessType The type of access control (allow or deny) to remove.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to remove an ACE.
accessMask The access mask for the ACE to be removed.
inheritanceFlags Flags that specify the inheritance properties of the ACE to be removed.
propagationFlags Flags that specify the inheritance propagation properties for the ACE to be removed.
public void
RemoveAccessSpecific​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
Removes the specified Access Control Entry (ACE) from the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object. Use this method for directory object Access Control Lists (ACLs) when specifying the object type or the inherited object type for the ACE to be removed.
accessType The type of access control (allow or deny) to remove.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to remove an ACE.
accessMask The access mask for the ACE to be removed.
inheritanceFlags Flags that specify the inheritance properties of the ACE to be removed.
propagationFlags Flags that specify the inheritance propagation properties for the ACE to be removed.
objectFlags Flags that specify if the <paramref name="objectType" /> and <paramref name="inheritedObjectType" /> parameters contain non- <see langword="null" /> values.
objectType The identity of the class of objects to which the removed ACE applies.
inheritedObjectType The identity of the class of child objects which can inherit the removed ACE.
public void
RemoveAccessSpecific​(AccessControlType accessType, Principal.​SecurityIdentifier sid, ObjectAccessRule rule)
Removes the specified Access Control Entry (ACE) from the current <see cref="T:System.Security.AccessControl.DiscretionaryAcl" /> object.
accessType The type of access control (allow or deny) to remove.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to remove an ACE.
rule The <see cref="T:System.Security.AccessControl.ObjectAccessRule" /> for which to remove access.
public void
SetAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags)
Sets the specified access control for the specified <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.
accessType The type of access control (allow or deny) to set.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to set an ACE.
accessMask The access rule for the new ACE.
inheritanceFlags Flags that specify the inheritance properties of the new ACE.
propagationFlags Flags that specify the inheritance propagation properties for the new ACE.
public void
SetAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType)
Sets the specified access control for the specified <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.
accessType The type of access control (allow or deny) to set.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to set an ACE.
accessMask The access rule for the new ACE.
inheritanceFlags Flags that specify the inheritance properties of the new ACE.
propagationFlags Flags that specify the inheritance propagation properties for the new ACE.
objectFlags Flags that specify if the <paramref name="objectType" /> and <paramref name="inheritedObjectType" /> parameters contain non- <see langword="null" /> values.
objectType The identity of the class of objects to which the new ACE applies.
inheritedObjectType The identity of the class of child objects which can inherit the new ACE.
public void
SetAccess​(AccessControlType accessType, Principal.​SecurityIdentifier sid, ObjectAccessRule rule)
Sets the specified access control for the specified <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.
accessType The type of access control (allow or deny) to set.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> for which to set an ACE.
rule The <see cref="T:System.Security.AccessControl.ObjectAccessRule" /> for which to set access.
public void
GetBinaryForm​(byte[] binaryForm, int offset)
Inherited from CommonAcl
Marshals the contents of the <see cref="T:System.Security.AccessControl.CommonAcl" /> object into the specified byte array beginning at the specified offset.
binaryForm The byte array into which the contents of the <see cref="T:System.Security.AccessControl.CommonAcl" /> is marshaled.
offset The offset at which to start marshaling.
public void
Purge​(Principal.​SecurityIdentifier sid)
Inherited from CommonAcl
Removes all access control entries (ACEs) contained by this <see cref="T:System.Security.AccessControl.CommonAcl" /> object that are associated with the specified <see cref="T:System.Security.Principal.SecurityIdentifier" /> object.
sid The <see cref="T:System.Security.Principal.SecurityIdentifier" /> object to check for.
public void
RemoveInheritedAces​()
Inherited from CommonAcl
Removes all inherited access control entries (ACEs) from this <see cref="T:System.Security.AccessControl.CommonAcl" /> object.
public void
CopyTo​(GenericAce[] array, int index)
Inherited from GenericAcl
Copies each <see cref="T:System.Security.AccessControl.GenericAce" /> of the current <see cref="T:System.Security.AccessControl.GenericAcl" /> into the specified array.
array The array into which copies of the <see cref="T:System.Security.AccessControl.GenericAce" /> objects contained by the current <see cref="T:System.Security.AccessControl.GenericAcl" /> are placed.
index The zero-based index of <paramref name="array" /> where the copying begins.
public AceEnumerator
GetEnumerator​()
Inherited from GenericAcl
Retrieves an object that you can use to iterate through the access control entries (ACEs) in an access control list (ACL).
Returns An enumerator object.
public bool
Equals​(object obj)
Inherited from object
protected void
Finalize​()
Inherited from object
public int
GetHashCode​()
Inherited from object
public Type
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object
public string
ToString​()
Inherited from object