Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

IsUserInRole

Contributor ,
Jun 17, 2008 Jun 17, 2008
Hi guys and gals,

I've been looking at this for two hours now and can't see anything wrong with this code...but when i run it I get this output - the dump from the query shows the f_role field is "agent". The first cfoutput confirms this, the second cfoutput shows it's assigning the login info correctly, as it shows the GetAuthUser is Barney...but the IsUserInRole("agent") says NO...even though it is???!

Does anyone have any idea please???!

Screen output
//////////////////////////////////////////
query - Top 1 of 1 Rows
F_PASSWORD F_ROLE F_USER RID
1 123456 agent Barney 3

agent Barney NO
//////////////////////////////////////////
TOPICS
Getting started
403
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Jun 17, 2008 Jun 17, 2008
Why is it that as soon as you hit the POST button you find the answer!

The code is fine...it was the fieldtype in my database - it was set as a nchar and so had trailing spaces...although they weren't output on screen CF was obviously interpreting them and therefore failing on the comparison. Doh!
Translate
Contributor ,
Jun 17, 2008 Jun 17, 2008
Why is it that as soon as you hit the POST button you find the answer!

The code is fine...it was the fieldtype in my database - it was set as a nchar and so had trailing spaces...although they weren't output on screen CF was obviously interpreting them and therefore failing on the comparison. Doh!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Jun 24, 2008 Jun 24, 2008
LATEST
I like to use the "#Trim(string)# function upon committing to the database. It takes care of inadvertant leading and trailing spaces entered by data entry operators and text imports.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources