Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I check if a user has a certain role in their profile
#4
I'm glad you got it all sorted out!

The problem with this snippet of code:
[code2=vbnet]Select Case UCase(dbData(0).ToString)
Case Is = "Admin"
TSMenuItemOptions.Enabled = True
Case Is = "Manager"
TSMenuItemOptions.Enabled = True
Case Is = "User"
TSMenuItemOptions.Enabled = False
End Select[/code2]

Is that UCase actually converts whatever string you input as a parameter into an uppercase string, so to fix the problem you must change the code to this:
[code2=vbnet]Select Case UCase(dbData(0).ToString)
Case Is = "ADMIN"
TSMenuItemOptions.Enabled = True
Case Is = "MANAGER"
TSMenuItemOptions.Enabled = True
Case Is = "USER"
TSMenuItemOptions.Enabled = False
End Select[/code2]
My Blog | My Setup | My Videos | Have a wonderful day.


Messages In This Thread
Re: How do I check if a user has a certain role in their pro - by brandonio21_phpbb3_import2 - 11-12-2012, 09:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Auto-generating Drop Menus from User Input MadManMallard 2 12,545 09-17-2014, 09:41 AM
Last Post: brandonio21
  How can I set profile for a user??? mnxford 5 20,843 04-12-2013, 06:31 PM
Last Post: brandonio21
  Computer User vbcodegeek 6 22,433 11-01-2011, 06:01 PM
Last Post: openeXpressions

Forum Jump:


Users browsing this thread: 1 Guest(s)