DiscretionaryAcl.AddAccess Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds an Access Control Entry (ACE) with the specified settings to the current DiscretionaryAcl object.
AddAccess(AccessControlType, SecurityIdentifier, ObjectAccessRule) |
Adds an Access Control Entry (ACE) with the specified settings to the current DiscretionaryAcl object. |
AddAccess(AccessControlType, SecurityIdentifier, Int32, InheritanceFlags, PropagationFlags) |
Adds an Access Control Entry (ACE) with the specified settings to the current DiscretionaryAcl object. |
AddAccess(AccessControlType, SecurityIdentifier, Int32, InheritanceFlags, PropagationFlags, ObjectAceFlags, Guid, Guid) |
Adds an Access Control Entry (ACE) with the specified settings to the current 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. |
Adds an Access Control Entry (ACE) with the specified settings to the current DiscretionaryAcl object.
public:
void AddAccess(System::Security::AccessControl::AccessControlType accessType, System::Security::Principal::SecurityIdentifier ^ sid, System::Security::AccessControl::ObjectAccessRule ^ rule);
public void AddAccess (System.Security.AccessControl.AccessControlType accessType, System.Security.Principal.SecurityIdentifier sid, System.Security.AccessControl.ObjectAccessRule rule);
member this.AddAccess : System.Security.AccessControl.AccessControlType * System.Security.Principal.SecurityIdentifier * System.Security.AccessControl.ObjectAccessRule -> unit
Public Sub AddAccess (accessType As AccessControlType, sid As SecurityIdentifier, rule As ObjectAccessRule)
Parameters
- accessType
- AccessControlType
The type of access control (allow or deny) to add.
The SecurityIdentifier for which to add an ACE.
- rule
- ObjectAccessRule
The ObjectAccessRule for the new access.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9 |
.NET Framework | 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5 |
Adds an Access Control Entry (ACE) with the specified settings to the current DiscretionaryAcl object.
public:
void AddAccess(System::Security::AccessControl::AccessControlType accessType, System::Security::Principal::SecurityIdentifier ^ sid, int accessMask, System::Security::AccessControl::InheritanceFlags inheritanceFlags, System::Security::AccessControl::PropagationFlags propagationFlags);
public void AddAccess (System.Security.AccessControl.AccessControlType accessType, System.Security.Principal.SecurityIdentifier sid, int accessMask, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags);
member this.AddAccess : System.Security.AccessControl.AccessControlType * System.Security.Principal.SecurityIdentifier * int * System.Security.AccessControl.InheritanceFlags * System.Security.AccessControl.PropagationFlags -> unit
Public Sub AddAccess (accessType As AccessControlType, sid As SecurityIdentifier, accessMask As Integer, inheritanceFlags As InheritanceFlags, propagationFlags As PropagationFlags)
Parameters
- accessType
- AccessControlType
The type of access control (allow or deny) to add.
The SecurityIdentifier for which to add an ACE.
- accessMask
- Int32
The access rule for the new ACE.
- inheritanceFlags
- InheritanceFlags
Flags that specify the inheritance properties of the new ACE.
- propagationFlags
- PropagationFlags
Flags that specify the inheritance propagation properties for the new ACE.
Remarks
This method can cause existing ACEs to be merged.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5 |
AddAccess(AccessControlType, SecurityIdentifier, Int32, InheritanceFlags, PropagationFlags, ObjectAceFlags, Guid, Guid)
Adds an Access Control Entry (ACE) with the specified settings to the current 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.
public:
void AddAccess(System::Security::AccessControl::AccessControlType accessType, System::Security::Principal::SecurityIdentifier ^ sid, int accessMask, System::Security::AccessControl::InheritanceFlags inheritanceFlags, System::Security::AccessControl::PropagationFlags propagationFlags, System::Security::AccessControl::ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType);
public void AddAccess (System.Security.AccessControl.AccessControlType accessType, System.Security.Principal.SecurityIdentifier sid, int accessMask, System.Security.AccessControl.InheritanceFlags inheritanceFlags, System.Security.AccessControl.PropagationFlags propagationFlags, System.Security.AccessControl.ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType);
member this.AddAccess : System.Security.AccessControl.AccessControlType * System.Security.Principal.SecurityIdentifier * int * System.Security.AccessControl.InheritanceFlags * System.Security.AccessControl.PropagationFlags * System.Security.AccessControl.ObjectAceFlags * Guid * Guid -> unit
Public Sub AddAccess (accessType As AccessControlType, sid As SecurityIdentifier, accessMask As Integer, inheritanceFlags As InheritanceFlags, propagationFlags As PropagationFlags, objectFlags As ObjectAceFlags, objectType As Guid, inheritedObjectType As Guid)
Parameters
- accessType
- AccessControlType
The type of access control (allow or deny) to add.
The SecurityIdentifier for which to add an ACE.
- accessMask
- Int32
The access rule for the new ACE.
- inheritanceFlags
- InheritanceFlags
Flags that specify the inheritance properties of the new ACE.
- propagationFlags
- PropagationFlags
Flags that specify the inheritance propagation properties for the new ACE.
- objectFlags
- ObjectAceFlags
Flags that specify if the objectType
and inheritedObjectType
parameters contain non-null
values.
- objectType
- Guid
The identity of the class of objects to which the new ACE applies.
- inheritedObjectType
- Guid
The identity of the class of child objects which can inherit the new ACE.
Remarks
This method can cause existing ACEs to be merged.
Applies to
.NET 9 and other versions
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, 6 (package-provided), 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
Windows Desktop | 3.0, 3.1, 5 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: