Without Option Strict Off, the compiler wouldn't even let you try to stuff three different return values into a boolean value, as Jeff Atwood's colleague likes to do ...
Friend ReadOnly Property CheckUserRole() As Boolean
Get
Dim user As SystemUser = SystemUser.CurrentUser
If user.AssertRole(RoleTypes.Admin) Then
Return 0
Else
If user.AssertRole(RoleTypes.Training) Then
Return 1
Else
If user.AssertRole(RoleTypes.Supervisor) Then
Return 2
End If
End If
End If
End Get
End Property
[Advertisement]
BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!