0

I have a lightning component in a Beta Managed Package that uses a Custom Setting to define in which unit a value is shown. When using the component, the user has the option to click on a button that will change that current unit.

This is done by an Apex method that upserts the value of that unit (a record of this Custom Setting) from A to B. If you click again it goes back from B to A. Only those two options.

The thing is that apparently the only way to give WRITE access to one particular Custom Setting is by giving Write access to all Custom Settings in the Org, through the Customize Application permission (according to what I've read of Spring 20' release, link below).

I want a Standard User to be able to use the component and Upsert the record of this Custom Setting, without giving the User the access to write EVERY Custom Setting in the Org.

Is this possible? (I've tried Custom Setting Definition in Permission Set but this gives just read access, not write).

By the way the Apex Method uses SObjectAccessDecision to strip inaccessible fields, which triggers the error when the user does not have write access on that custom setting field.

Thanks!

https://releasenotes.docs.salesforce.com/en-us/spring20/release-notes/rn_forcecom_custom_settings_access_cruc_addWinter.htm#:~:text=Go%20to%20the%20profile%20or,Definitions%20list%2C%20then%20click%20Save.

  • Perhaps this is helpful: Here is an approach for giving users the ability to edit their own custom setting: salesforce.stackexchange.com/a/45079/10073 – Peter Noges Sep 24 at 19:21
  • Hi Peter, this helped (no good news for me though). Custom settings have two permissions: Everyone can always read a public custom setting (and apex code can). If the setting is a protected and it is within a managed package, then no one can read the setting (but Apex code running within the namespace can). Only those with 'customize application' permission can modify a public custom setting. No one can modify a protected custom setting (but apex code running in the namespace can). So there's apparently no solution to give write access to just one specific Custom Setting. – TEo Sep 24 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.