Gets a value indicating whether the specified user is in the specified role.
Namespace: Novalys.VisualGuard.Security.MembershipAssembly: Novalys.VisualGuard.Security (in Novalys.VisualGuard.Security.dll) Version: 2016.0.105.16 (2016.0.105.16)
Syntax
C# |
---|
[ObsoleteAttribute("Use a method IsUserInRole(VGMembershipUser user, VGRole role)")] public bool IsUserInRoleById( string userId, Guid roleId ) |
Visual Basic |
---|
<ObsoleteAttribute("Use a method IsUserInRole(VGMembershipUser user, VGRole role)")> Public 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
Type: Booleantrue if the specified user is in the specified role; otherwise, false.
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | userId is null. |
System..::..ArgumentException | userId is an empty string.
-or- userId was not found in the repository |
System.Security..::..SecurityException | The current user does not have 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. |