The My.User.IsInRole method lets your code to determine whether the current user is a member of the specified role.
The overload of the My.User.IsInRole method that takes a string provides easy access to the IsInRole method of the current principal.
The overload of the My.User.IsInRole method that takes a BuiltInRole enumeration behaves differently, depending on the current principal. If it is a Windows user principal (WindowsPrincipal), this function converts role to the equivalent WindowsBuiltInRole enumeration and returns the result of calling IsInRole. If the current principal is any other principal, this function passes the name of the enumeration value in role to the principal's IsInRole method.
Note: |
|---|
The exact behavior of the
My.User object depends on the type of the application and on the operating system on which the application runs. For more information, see My.User Object.
|