Exploring Flex

Secure operations in a CFC

Posted by hneelu on June 11, 2009

Create an Application.cfm file and place it in folder called ‘SecureCF’

Application.cfm
<cfapplication name=”authTest” />
<cflogin>
<cfif isDefined(“cflogin”)>
<cfif cflogin.name eq “admin” and
cflogin.password eq “admin”>

<cfloginuser name=”#cflogin.name#”
password=”#cflogin.password#”
roles=”admin” /></cfif></cfif>
</cflogin>

In the same folder, add the required CFC file.

Modify the required operation as follows:

<cffunction name=”sayHelloArray” access=”remote” returnType=”array” roles=”admin”>

You can add any number of roles in the CFM file and use them accordingly.

NOTE: Only one role per operation is allowed.

One Response to “Secure operations in a CFC”

  1. Amazing blog! Is your theme custom made or did you download it from somewhere?
    A theme like yours with a few simple tweeks would really make my
    blog stand out. Please let me know where you got
    your design. Many thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: