RE: isUserInRole takes multiple roles?
It can take a list, but it works as an AND (the user needs ALL the roles in the list). If you want OR, there was a simple IsUserInAnyRole() UDF by Raymond Camden I believe. Pascal -Original Message- From: Alex Sherwood [mailto:[EMAIL PROTECTED] Sent: 02 February 2005 14:54 To: CF-Talk Subject: isUserInRole takes multiple roles? Question: Does the inUserInRole() function take a list of roles or a single role? The Complete ColdFusionMX Reference has an example where multiple roles are passed in, but I cannot get it to work. I find it hard to believe that they would publish an example that would be incorrect (an not due to a typo). Thanks, -- Alex Sherwood Director, Internet Services PHS Collection Agency Phone: 813-283-4579 Web: www.phs-net.com ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192755 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: isUserInRole takes multiple roles?
On Wed, 02 Feb 2005 08:53:31 -0500, Alex Sherwood [EMAIL PROTECTED] wrote: Does the inUserInRole() function take a list of roles or a single role? It can take a list - see: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funct142.htm The Complete ColdFusionMX Reference has an example where multiple roles are passed in, but I cannot get it to work. Bear in mind that it checks the user is in *all* of the roles: cfif isUserInRole(admin,hr) ... only true if user has BOTH roles ... /cfif If user is just an admin or just an HR person, that test will be false. That tends to surprise people. -- Sean A Corfield -- http://www.corfield.org/ Team Fusebox -- http://www.fusebox.org/ Breeze Me! -- http://www.corfield.org/breezeme Got Gmail? -- I have 50, yes 50, invites to give away! If you're not annoying somebody, you're not really alive. -- Margaret Atwood ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192758 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: isUserInRole takes multiple roles?
Pascal Peters wrote: It can take a list, but it works as an AND (the user needs ALL the roles in the list). If you want OR, there was a simple IsUserInAnyRole() UDF by Raymond Camden I believe. Pascal That's what I thought..Thanks Pascal... -- Alex ~| Logware (www.logware.us): a new and convenient web-based time tracking application. Start tracking and documenting hours spent on a project or with a client with Logware today. Try it for free with a 15 day trial account. http://www.houseoffusion.com/banners/view.cfm?bannerid=67 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192765 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: isUserInRole takes multiple roles?
It's doubly confusing because the ROLES attribute of CFFUNCTION works in the reverse way. IsUserInRole does an AND to check for ALL roles, while CFFUNCTION does an OR to check for ANY role. cheers, barneyb On Wed, 2 Feb 2005 07:38:38 -0800, Sean Corfield [EMAIL PROTECTED] wrote: On Wed, 02 Feb 2005 08:53:31 -0500, Alex Sherwood [EMAIL PROTECTED] wrote: Does the inUserInRole() function take a list of roles or a single role? It can take a list - see: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funct142.htm The Complete ColdFusionMX Reference has an example where multiple roles are passed in, but I cannot get it to work. Bear in mind that it checks the user is in *all* of the roles: cfif isUserInRole(admin,hr) ... only true if user has BOTH roles ... /cfif If user is just an admin or just an HR person, that test will be false. That tends to surprise people. -- Sean A Corfield -- http://www.corfield.org/ Team Fusebox -- http://www.fusebox.org/ Breeze Me! -- http://www.corfield.org/breezeme Got Gmail? -- I have 50, yes 50, invites to give away! If you're not annoying somebody, you're not really alive. -- Margaret Atwood -- Barney Boisvert [EMAIL PROTECTED] 360.319.6145 http://www.barneyb.com/ Got Gmail? I have 6 invites. ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192775 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: isUserInRole takes multiple roles?
Sean Corfield wrote: On Wed, 02 Feb 2005 08:53:31 -0500, Alex Sherwood [EMAIL PROTECTED] wrote: Does the inUserInRole() function take a list of roles or a single role? It can take a list - see: http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/funct142.ht Thanks, Sean. My local ColdFusion CHM file didn't have the part about multiples. Thanks! -- Alex ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:192776 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54