Share via


SPClaimsAuthRoleProvider.DeleteRole method

Removes a role from the data source for the application represented by the ApplicationName property.

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

Syntax

'Declaration
Public Overrides Function DeleteRole ( _
    roleName As String, _
    throwOnPopulatedRole As Boolean _
) As Boolean
'Usage
Dim instance As SPClaimsAuthRoleProvider
Dim roleName As String
Dim throwOnPopulatedRole As Boolean
Dim returnValue As Boolean

returnValue = instance.DeleteRole(roleName, _
    throwOnPopulatedRole)
public override bool DeleteRole(
    string roleName,
    bool throwOnPopulatedRole
)

Parameters

  • throwOnPopulatedRole
    Type: System.Boolean

    true to throw an exception if there are one or more members in the specified role; otherwise, false.

Return value

Type: System.Boolean
true if the role was successfully deleted; otherwise, false.

Exceptions

Exception Condition
ProviderException

roleName has one or more members and throwOnPopulatedRole is true.

Remarks

If throwOnPopulatedRole is false, this override deletes the role whether it is empty or not.

See also

Reference

SPClaimsAuthRoleProvider class

SPClaimsAuthRoleProvider members

Microsoft.SharePoint.Administration.Claims namespace