Also note that roles are space-sensitive as well as case-sensitive, so if
you login a user with roles="admin, clerk" he has the roles "admin" and "
clerk" rather than "admin" and "clerk", so the clerk role will not test
correctly against IsUserInRole("clerk").

For this reason we always uppercase and trim our roles before using them in
a CFLOGINUSER tag.

And thanks for the kudos on The ColdFusion MX Bible! :)

Respectfully,

Adam Phillip Churvis
Member of Team Macromedia

Advanced Intensive Training:
* C# & ASP.NET for ColdFusion Developers
* ColdFusion MX Master Class
* Advanced Development with CFMX and SQL Server 2000
http://www.ColdFusionTraining.com

Download CommerceBlocks V2.1 and LoRCAT from
http://www.ProductivityEnhancement.com

The ColdFusion MX Bible is in bookstores now!
----- Original Message -----
From: "Dina Hess" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, October 03, 2004 12:37 PM
Subject: Re: cflogin ?

> Further clarification:
>
> Roles are case sensitive
>
> l<cfif IsUserInRole("Sales,Manager")> means the user must be in both roles
>
> l<cfif IsUserInRole("Sales") or IsUserInRole("Manager")> means the user
must
> be in one role or the other
>
> <cffunction name="somemethod" roles="Sales,Manager"> means this method can
> only be executed by a user who has been authenticated and authorized by
> belonging to any of the named roles
>
> ~Dina
>
>   ----- Original Message -----
>   From: Patricia Lee
>   To: CF-Talk
>   Sent: Sunday, October 03, 2004 7:17 AM
>   Subject: Re: cflogin ?
>
>
>   <cfif NOT IsUserInRole('admin') AND NOT IsUserInRole('user')>
>                                   ^^^
>   -Patti
>
>   > i cant ever find anything that tells how to check for more than 1
>   > acceptable roles
>   >
>   > so, say there are 2 roles (admin, user) and both can access the same
> pages
>   > would it be?
>   >
>   > <!--- check to see if user is logged in --->
>   > <cfif NOT IsUserInRole('admin') OR NOT IsUserInRole('user')>
>   > <cflocation url="" addtoken="no">
>   > <cfabort>
>   > </cfif>
>   >
>   >
>   > i cant find any docs that give any info on it
>   > tia
>   >
>   >
>   >
>   >
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to