Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

RoleProvider.RemoveUsersFromRoles Method

Removes the specified user names from the specified roles for the configured applicationName.

Namespace:  System.Web.Security
Assembly:  System.Web.ApplicationServices (in System.Web.ApplicationServices.dll)
abstract RemoveUsersFromRoles : 
        usernames:string[] * 
        roleNames:string[] -> unit

Parameters

usernames
Type: System.String[]

A string array of user names to be removed from the specified roles.

roleNames
Type: System.String[]

A string array of role names to remove the specified user names from.

RemoveUsersFromRoles is called by RemoveUserFromRole , RemoveUsersFromRole , RemoveUserFromRoles , and RemoveUsersFromRoles methods of the Roles class to remove the specified users from the specified roles at the data source. Only roles for the configured ApplicationName are modified.

If any of the specified role names are not found for the configured applicationName, we recommend that your provider throw a ProviderException.

If any of the specified user names are not associated with any of the specified role names for the configured applicationName, we recommend that your provider throw a ProviderException.

If any of the specified user names is a null reference (Nothing in Visual Basic) or is an empty string, we recommend that your provider throw an exception.

If any of the specified role names is a null reference (Nothing in Visual Basic) or is an empty string, we recommend that your provider throw an exception.

If your data source supports transactions, we recommend that you include each remove operation in a transaction and that you roll back the transaction and throw an exception if any remove operation fails.

The following code example shows a sample implementation of the RemoveUsersFromRoles method.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.