> -----Original Message-----
> From: Candace Cottrell [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 30, 2003 11:07 AM
> To: CF-Talk
> Subject: RE: Cfswitch question
>
> Thanks Jim...
>
> Sooo, I guess I have to do this by going through each of my roles and
> doing cfifs?
Pretty much.
I've personally never used CFLOGIN, but my own security system is similar.
I create a list of approved roles in each user's session scope and use UDFs
to deal with it. You can do the same thing with "IsUserInRole()"
So instead of really clunky CFIFs you end up with a little more streamlined
CFIFs:
<cfif IsUSerInRole("Admin")>
<h2>Administrator Functions: </h2>
</cfif>
<cfif IsUSerInRole("Facilities")>
<h2>Facilities Functions: </h2>
</cfif>
This is actually a bit more flexible than CFSWITCH in any case as a user can
be in more than one role (I'm not sure if that's possible in your situation,
but using CFIF it's technically simpler - CFSWITCH would stop at the first
match).
Jim Davis
> Seems like I am "hardcoding" almost.
>
>
> Candace K. Cottrell, Web Developer
> The Children's Medical Center
> One Children's Plaza
> Dayton, OH 45404
> 937-641-4293
> http://www.childrensdayton.org
>
>
> [EMAIL PROTECTED]
>
> >>> [EMAIL PROTECTED] 6/30/2003 11:01:08 AM >>>
> It's not illegal, but it won't work.
>
> IsUserInRole() takes a role and returns a Boolean (true/false) - it
> really
> can't be used in a switch like that. (The "value" attribute looks at
> the
> RETURN of "expression" - it doesn't act as input to it.)
>
> Jim Davis
>
>
>
> > -----Original Message-----
> > From: Candace Cottrell [mailto:[EMAIL PROTECTED]
> > Sent: Monday, June 30, 2003 10:55 AM
> > To: CF-Talk
> > Subject: Cfswitch question
> >
> > Is this illegal?
> >
> > <Cfswitch expression="IsUserInRole()">
> > <CfCase value="Admin">
> > <h2>Administrator Functions: </h2>
> > </cfcase>
> > <CfCase value="Facilities">
> > <h2>Facilities Functions: </h2>
> > </cfcase>
> >
> > </Cfswitch>
> >
> > Candace K. Cottrell, Web Developer
> > The Children's Medical Center
> > One Children's Plaza
> > Dayton, OH 45404
> > 937-641-4293
> > http://www.childrensdayton.org
> >
> >
> > [EMAIL PROTECTED]
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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