Exploring Flex

Posts Tagged ‘secure’

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.

Advertisements

Posted in coldfusion | Tagged: , | 1 Comment »