If you pass N roles to isUserInRole, it is treated as an AND list, ie,
if you pass 2,4, it means the user must be in 2 and in 4. To get around
this, simply code your own UDF, or borrow the one I wrote up at
cflib.org. I _believe_ it is called IsUserInAnyRole.

========================================================================
===
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
(www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda 

> -----Original Message-----
> From: Jeff Lucido [mailto:[EMAIL PROTECTED] 
> Sent: Monday, August 11, 2003 1:13 PM
> To: CF-Talk
> Subject: CFLOGIN and isUserInRole issues
> 
> 
> I am pretty sure I have the world's easiest problem, however 
> I having fits using the function "isUserInRole." 
> Specifically, when I authenticate a user I pull all of their 
> group ID privileges and turn them into a list. I assign this 
> list to the roles attribute of cfloginuser. Now, when I 
> specifically, know I want to keep someone out of a certain 
> section, I can easily use isUserInRole("6") to decided 
> whether or not to provide them with the privilege item.
> 
> Now, I have a recordset from a query of available links which 
> have a single security value, at_id. When I loop through the 
> recordset I want to display the link based on whether or not 
> the person has the proper privileges. For example:
> 
> User 
> Roles = 1,2,3
> 
> Recordset (qFoo)
> At_id = 2,4
> 
> <cfloop query="qFoo">
>   <cfif isUserInRole("#qFoo.at_id#")>
>     -- When recordset containing at_id = 2 is processed, 
> display this string --
>   </cfif>
> </cfloop>
> 
> I hope I made some sense. I tried an index loop and that did 
> not work either (or at least my implementation). Any 
> suggestions? I really like the functions associated with the 
> CFLOGIN tag so rolling my own is not an option at this point 
> (unless I really have to).
> 
> Any and all help is greatly appreciated!!
> -JSLucido
> 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Get the mailserver that powers this list at 
http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to