SPAcl<T>.Add method (String, String, SPIdentifierType, Byte[], T, T)

Adds a new ACE to the access control list, overwriting any existing ACE for the specified principal based on the specified principal name, principal display name, principal identifier type, security identifier, granted rights, and denied rights.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function Add ( _
    principalName As String, _
    displayName As String, _
    identifierType As SPIdentifierType, _
    identifier As Byte(), _
    grantRightsMask As T, _
    denyRightsMask As T _
) As SPAce(Of T)
'Usage
Dim instance As SPAcl
Dim principalName As String
Dim displayName As String
Dim identifierType As SPIdentifierType
Dim identifier As Byte()
Dim grantRightsMask As T
Dim denyRightsMask As T
Dim returnValue As SPAce(Of T)

returnValue = instance.Add(principalName, _
    displayName, identifierType, identifier, _
    grantRightsMask, denyRightsMask)
public SPAce<T> Add(
    string principalName,
    string displayName,
    SPIdentifierType identifierType,
    byte[] identifier,
    T grantRightsMask,
    T denyRightsMask
)

Parameters

  • principalName
    Type: System.String

    The login name of the principal.

  • displayName
    Type: System.String

    The display name of the principal.

  • identifier
    Type: []

    The identifier for a Windows principal.

  • grantRightsMask
    Type: T

    The rights to be granted.

  • denyRightsMask
    Type: T

    The rights to be denied.

Return value

Type: Microsoft.SharePoint.Administration.SPAce<T>
A new ACE that is added to the ACL.

Exceptions

Exception Condition
ArgumentNullException

identifier is null .

Remarks

This method adds a new ACE to the ACL.

See also

Reference

SPAcl<T> class

SPAcl<T> members

Add overload

Microsoft.SharePoint.Administration namespace