Privileged Module Configuration

From ADF Docs
Revision as of 21:56, 5 February 2025 by Gcronkright (talk | contribs) (Overview)
Jump to: navigation, search

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 Your 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>

Add a CommonSpot User Group

  1. Go to your CommonSpot Group Administration
  2. Create a Group with Add Data and/or Edit Data permissions
    1. No user or group needs to be added to this Privileged Module group.
Note: The user requesting to add or update data will be added to and then removed from the group after the call is made on the fly.

Update the Custom Element Security

  1. Add the newly created group to the Custom Element Security with ‘Add Data’ Rights