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.StringThe login name of the principal.
displayName
Type: System.StringThe display name of the principal.
identifierType
Type: Microsoft.SharePoint.Administration.SPIdentifierTypeThe identifier type of the principal using.
identifier
Type: []The identifier for a Windows principal.
grantRightsMask
Type: TThe rights to be granted.
denyRightsMask
Type: TThe 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.