Difference between revisions of "Privileged Module Configuration"

From ADF Docs
Jump to: navigation, search
(Update You Code)
Line 3: Line 3:
  
 
=== Update You Code ===
 
=== Update You Code ===
In your script that makes the call the ADF’s ceRecordAPI add a '''Request.User.enableApprovedPrivileges(Request);''' line before the call. And then add a '''Request.User.disableApprovedPrivileges();''' after the add/update call.
+
# In your script that makes the call the ADF’s ceRecordAPI add a '''Request.User.enableApprovedPrivileges(Request);''' line before the call.  
 +
# Then add a '''Request.User.disableApprovedPrivileges();''' after the add/update call.
  
 
  <cfscript>
 
  <cfscript>

Revision as of 21:39, 5 February 2025

Overview

To allow scripts that use the ADF's CE Record API or the CommonSpot's Custom Data API to add or update data by users with limited or anonymous (read-only) access add a couple of lines of code to your script and register it with Privilege Module rights.

Update You Code

  1. In your script that makes the call the ADF’s ceRecordAPI add a Request.User.enableApprovedPrivileges(Request); line before the call.
  2. Then add a Request.User.disableApprovedPrivileges(); after the add/update call.
<cfscript>
   // Enable addRecord() function to run for users with lower or anonymous permissions
   Request.User.enableApprovedPrivileges(Request);

   result = Application.ADF.gceRecord.addRecord(ceName=ceName,dataValues=dataValues);	
	
   // Reset the user's permissions
   Request.User.disableApprovedPrivileges();
</cfscript>