Share via


SPPolicyRoleCollection.Add method (String, String, SPBasePermissions, SPBasePermissions)

Adds a policy role to the collection based on the specified policy role name, description, granted rights, and denied rights.

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

Syntax

'Declaration
Public Function Add ( _
    name As String, _
    description As String, _
    grantRightsMask As SPBasePermissions, _
    denyRightsMask As SPBasePermissions _
) As SPPolicyRole
'Usage
Dim instance As SPPolicyRoleCollection
Dim name As String
Dim description As String
Dim grantRightsMask As SPBasePermissions
Dim denyRightsMask As SPBasePermissions
Dim returnValue As SPPolicyRole

returnValue = instance.Add(name, description, _
    grantRightsMask, denyRightsMask)
public SPPolicyRole Add(
    string name,
    string description,
    SPBasePermissions grantRightsMask,
    SPBasePermissions denyRightsMask
)

Parameters

  • name
    Type: System.String

    A string that contains the name of the policy role.

  • description
    Type: System.String

    A string that contains a description of the policy role.

Return value

Type: Microsoft.SharePoint.Administration.SPPolicyRole
An SPPolicyRole object that represents the new policy role.

See also

Reference

SPPolicyRoleCollection class

SPPolicyRoleCollection members

Add overload

Microsoft.SharePoint.Administration namespace