I have done my own.  There are lots of reasons why the cflogin system
was not appropriate for this site,  but most was that the CFLOGIN is
too one-size-fits-all for the organisation.

I have already built the security on this site - it's been in place
for 18 months now but i need to improve the way we contorl who does
what.  Now each page, each part of the site will have a set of
authorisations attached to it and only people with those permissions
will be able to do those functions for that page.

But anyway that wasnt my question.   I'm not going to debate
architecture decisions that were made ages ago and changing them would
require a LOT of rewriting.  Honestly, I do wish when someone asks a
question on this list like "How do I fix the problem with my Ford's
front wheel?"  there wouldnt be a whole host of answers like "you
should be driving a BMW." or "you should have bought a green car
instead."

My question was about how to compare two lists, and see if there is at
least one common value.     A way other than looping through one list
and looking for each value in turn in the other list that is.

Is there are more elegant way to do it than something like :
<cfset UserPermissions = "1000,1003,1005,1006,1007" /> (from the
user's login details held in the user.cfc)

<cfset Permissionsrequired = "1003,6048,6484,7809" /> (held in the
page header for that
page - a dynamic list compiled as the page is called)

        <cfset OkToGo = false />
<cfloop list = "#UserPermissions#" index="i">
   <cfset OkToGo = listfind(Permissionsrequired, "#i#") />
</cfloop>
<cfif OkToGo is false>
        <cflocation addtoken="no" url="/index.cfm" />
        <cfabort>
</cfif>

This all seems a bit clumsy to me but it will work.   What i dont like
about it is that it'll loop through all of hte user's permisson
values, even if it finds a mark on the first one.

Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month



On 4/15/07, Andrew Scott <[EMAIL PROTECTED]> wrote:
> Mike, thats the only method in CF that is the simplest without doing your
> own IsUserInRole()...
>
>
>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275253
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to