Lets you impersonate a user defined in a security context that is defined in Advanced Security. ColdFusion Server enforces the privileges and restrictions configured for the user with the Advanced Security rules.
Web application framework tags
<cfimpersonate securityContext = "SecurityContext" username = "Name" password = "Password" type = "CF" or "OS"> ... HTML or CFML code to execute ... </cfimpersonate>
cfapplication,
cfassociate,
cfauthenticate,
cferror,
cflock,
cfmodule
cfimpersonate
is typically used to run a block of code in a secure mode. For impersonation of type "CF," there is automatic enforcement of access control of ColdFusion resources such as files, data sources, and collections between the start and end tags of cfimpersonate
. If CF type impersonation is turned on, ColdFusion enforces the rules and policies specified for the user in the Advanced Security section of the ColdFusion Administrator. Therefore, there is no need to make multiple isAuthorized calls in the code to protect each resource.
For more information, see Advanced ColdFusion Administration.
<!--- This example shows the use of cfimpersonate to impersonate a person with the user name Bill and the password BJ4YE.---> <html> <head> <title>cfimpersonate Example</title> </head> <body> <cfimpersonate securityContext = "testContext" username = "Bill" password = "BJ4YE" type = "CF"> ... </cfimpersonate> </body> </html>