0

It is possible to declare a Apex controller class as

public without sharing class noSharing { } 

Is it possible to use Lightning Data Services

<force:recordData

Without sharing \ field level security?

Because I am getting this error:

You don't have access to this record. Ask your administrator for help or to request access.

When I use Lightning Data Services on a publicly available Salesforce community page.

  • Maybe there is a sharing design problem, if you are trying to show record via your custom component, which (record) isn't visible to the user ? – Oleksandr Berehovskyi Nov 8 '18 at 11:47
  • @OleksandrBerehovskiy I think it's because the page is on a publicly available page. – Robs Nov 8 '18 at 11:49
  • @Robs from when is LDS available for communities? – RedDevil Nov 8 '18 at 12:06
  • @RedDevil it works for communities now. See documentation – Robs Nov 8 '18 at 12:07
  • 1
    Can we get an idea going on overriding visibility, please? This is a good feature to have! – Prashanth K Nov 9 '18 at 3:26
1

Lightning components don’t automatically enforce CRUD and FLS when you reference objects or retrieve the objects from an Apex controller. This means that the framework continues to display records and fields for which users don’t have CRUD access and FLS visibility. You must manually enforce CRUD and FLS in your Apex controllers.

But when it comes to Lightning Data Service it handles sharing rules and field-level security for you. So if you want it not to enforce these rules you will have to go for custom code in place of LDS.

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.