Ok, my brain is hurting - I know this should be possible, but I can't quite
get the syntax.

I need to pass a string (a path to a structure which contains a boolean in
the session scope) into a function, which then checks the value:

i.e

<cfif checkPermission("email.send.all")>
Show a form or page
</cfif>

<cffunction name="checkPermission">
<cfargument name="path">
<cfif session.currentUser.permissions['#arguments.path#']>
<cfreturn true>
<cfelse>
<cfreturn false>
</cfif>
</cffunction>

So in this instance, CF is looking for
session.currentUser.permissions['email.send.all'] - i.e a structure key name
of 'email.send.all' , rather than
"session.currentUser.permissions.email.send.all"

Is there an elegant solution to this problem?

Ta
T


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334528
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to