I was waiting for someone to come in with a good arrays or structures
solution (because we use lists way too much and I want to learn more - more
- more!) . . . but since we are stuck with lists lets answer the question
you really asked. :) You want to know if ALL of the values in Deptid are in
session.privileges. I don't know if there is a custom tag, but the solution
is a quick loop . . .
<cflock name="seeotherthreadforthis:)" timeout="10">
<cfset variables.authorized = "True">
<cfloop list="#Deptid#" index="i">
<cfif not listfindnocase(session.privileges, i)>
<cfset variables.authorized = "False">
<cfbreak> <!--- no need to keep going --->
</cfif>
</cfloop>
</cflock>
Dan
-----Original Message-----
From: Ang�l Stewart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 13, 2000 9:39 AM
To: [EMAIL PROTECTED]
Subject: Variable IN a list? How to check?
How would i write this correctly in CFML?
<Cfif #Deptid# IN #session.privileges#>
Of course I want to check if the list of values in DeptID are all included
in the list of values in the session.privileges list of values.
Sooo..
deptid may be "11001, 12000,13000"
and session.privileges may be :
"ViewReports,AddUsers,AddGroups,11001,12000,13000,14000,18201"
In this case, the DeptIDs are all found in the Priviliges list, so the user
is authorised.
Umm..is there a single tag to run this check?
-Gel
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message
to [EMAIL PROTECTED] with 'unsubscribe' in the body.