1

Is there a way to check via Apex or Javascript (Lightning Component JS Controller) if current user has permission (profile or Permission set) to Edit fields on Account Object ? For example, i have a lightning component and i would like to make Account fields that user does not have write access, read only. And fields that current user has access to make them editable. Any suggestions please ?

2
  • You may just like to use lightning:recordEditForm in this case to build your custom component which takes care of field level security.
    – Jayant Das
    Commented Oct 22, 2019 at 14:02
  • Thanks, Jayant. Commented Oct 28, 2019 at 9:33

1 Answer 1

3

Yes. Salesforce does provide a mechanism in Apex to check the FLS for field for the current running user:

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_perms_enforcing.htm

There is also the FieldPermission SObject as well you can query against:

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_fieldpermissions.htm

1
  • Bryan, thank you very much for your response. Commented Oct 28, 2019 at 9:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .