Difference between revisions of "Privileged Module Configuration"

From ADF Docs
Jump to: navigation, search
(Update You Code)
(Overview)
Line 2: Line 2:
 
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.
 
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 ===
+
=== Update Your Code ===
 
# In your script that makes the call the ADF’s ceRecordAPI add a '''Request.User.enableApprovedPrivileges(Request);''' line before the 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.
 
# Then add a '''Request.User.disableApprovedPrivileges();''' after the add/update call.
Line 15: Line 15:
 
     Request.User.disableApprovedPrivileges();
 
     Request.User.disableApprovedPrivileges();
 
  </cfscript>
 
  </cfscript>
 +
 +
=== Add a CommonSpot User Group ===
 +
# Go to your CommonSpot Group Administration
 +
# Create a Group with Add Data and/or Edit Data permissions
 +
## 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 ===
 +
#
 +
# Add the newly created group to the Custom Element Security with ‘Add Data’ Rights

Revision as of 21:56, 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 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