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
2

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. – Giorgos Galaios Oct 28 '19 at 9:33

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.