SimpleRoleProvider.IsUserInRole Method
Returns a value that indicates whether the specified user is in the specified role.
Namespace: WebMatrix.WebData
Assembly: WebMatrix.WebData (in WebMatrix.WebData.dll)
Syntax
'Declaration
Public Overrides Function IsUserInRole ( _
username As String, _
roleName As String _
) As Boolean
'Usage
Dim instance As SimpleRoleProvider
Dim username As String
Dim roleName As String
Dim returnValue As Boolean
returnValue = instance.IsUserInRole(username, _
roleName)
public override bool IsUserInRole(
string username,
string roleName
)
public:
virtual bool IsUserInRole(
String^ username,
String^ roleName
) override
abstract IsUserInRole :
username:string *
roleName:string -> bool
override IsUserInRole :
username:string *
roleName:string -> bool
public override function IsUserInRole(
username : String,
roleName : String
) : boolean
Parameters
- username
Type: System.String
The user name.
- roleName
Type: System.String
The name of the role.
Return Value
Type: System.Boolean
true if the user is in the role; otherwise, false.
Remarks
Note
If the WebSecurity.InitializeDatabaseConnection() method has not been called, and if you have configured your site to use the standard ASP.NET role provider, this method is passed through to the standard role provider. For more information, see the SimpleRoleProvider class overview.