Gets a value indicating whether the specified user is in the specified role.

Namespace:  Novalys.VisualGuard.Security.Membership
Assembly:  Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 3.2.912.1 (3.2.912.01)

Syntax

C#
public static bool IsUserInRoleById(
	string userId,
	Guid roleId
)
Visual Basic (Declaration)
Public Shared Function IsUserInRoleById ( _
	userId As String, _
	roleId As Guid _
) As Boolean

Parameters

userId
Type: System..::.String
The repository id of the user to search for.
roleId
Type: System..::.Guid
The repository id of the role to search in.

Return Value

true if the specified user is in the specified role; otherwise, false.

Exceptions

ExceptionCondition
System..::.ArgumentNullException userId is null.
System..::.ArgumentException userId is an empty string.

-or-

userId was not found in the repository
System.Security..::.SecurityExceptionThe current user has not enough privileges to use Membership API. The Membership access level of the application must be sufficient to allows this action or the 'Membership Manager' role must be granted to the user by using the Visual Guard console.

See Also