Nope, sorry if I wasn't clear. The problem is not setting a user to
roles A,B,C. There is no problem saying IsUserInRole("A"). If the user
has roles A,B,C then they will be ok. The problem is this:
If you do
<cfif isUserInRoles("a,b")>
You may think, "This is how I check for A OR B"
However, what it's really doing is "Is User in roles A AND B"
So, there is no native way to check if a user is in EITHER role A or B
(or whatever).
If that is what you want, you simply rewrite as:
<cfif isUserInRole("A") or isUserInRole("B")>
Or you use the UDF I mentioned at cflib.
Does it make sense now?
A typical scenario where you need this is the concept of
For this action, only an editor or the ROOT admin can do it.
Ie, ROOT users can do _anything_.
That help?
========================================================================
===
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: Michael T. Tangorre [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 17, 2003 8:08 AM
> To: CF-Talk
> Subject: Re: Can the user's role in CFLOGIN be a list?
>
>
> Ray,
>
> Just so I am clear, are you saying that if a user logs into
> my system and has the roles set "role1,role2,role3" and I
> want to allow users with different roles access to different
> areas of the site such as:
>
> IsUserInRole("role1")
>
>
> the user above in role1, role2 and role3 will notr gian
> access because he/she needs to be in all 3 roles???
>
> Mike
>
>
>
> ----- Original Message -----
> From: "Raymond Camden" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Thursday, July 17, 2003 9:56 AM
> Subject: RE: Can the user's role in CFLOGIN be a list?
>
>
> > One thing to remember. If you do
> >
> > isUserInRole("a,b")
> >
> > It's an AND check. Ie, the user has to be in both. If you want the
> > logic of
> >
> > IsUserInANYRole("a,b")
> >
> > You have to write a UDF for it. I wrote one for CFLIb.org.
> >
> > This also means you can't apply that logic to CFC methods using
> > roles="a,b" in the cffunction tag. However, it's trivial to add the
> > logic INSIDE the method.
> >
> >
> ======================================================================
> > ==
> > ===
> > 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 Small [mailto:[EMAIL PROTECTED]
> > > Sent: Thursday, July 17, 2003 7:53 AM
> > > To: CF-Talk
> > > Subject: Re: Can the user's role in CFLOGIN be a list?
> > >
> > >
> > > On Thu, 17 Jul 2003 08:41:30 -0500
> > > "Raymond Camden" <[EMAIL PROTECTED]> wrote:
> > > >You set your roles to "admin, creative" ? Notice the
> > > >space before
> > > >creative. " creative" is not equal to "creative"
> > >
> > > You da man...and my forehead hurts from banging it on my desk.
> > >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4