Is there a SKUID equivalent to 'System.runAs(User u)'?

edited August 16, 2019 in Questions
I have some sensitive data that I'd like to report on in aggregate and have all my users be able to access. So while they shouldn't have access to the individual records, they should have access to reports and charts based on this aggregated data. I can't use SKUID charts because it requires users to have access to the records first. Is there a way to query a model as a different user?

Comments

  • Zach McElrathZach McElrath Principal Software Engineer Chattanooga, TN 💎💎💎
    edited August 16, 2019
    Eulogio, the only way to do this is to create an Apex REST API in Salesforce that performs the aggregate queries on the data and exposes it regardless of sharing settings. You can then use a REST Model in Skuid to retrieve data from this custom REST API and display it within Skuid. 
  • edited February 22, 2018
    Thanks for the recommendation Zach! I'll try your method.
  • edited March 1, 2018
    Hi Zach,

    I was able to create a RestResource and connect it to Skuid via a REST model, but I'm not able to get any data to come through.  This is what I'm receiving:
    {type: "TBC_Demographics_Survey_Response__c", url: "/services/data/v42.0/sobjects/TBC_Demographics_Survey_Response__c/a5L80000000643wEAA", __skuid_record__: ba}
    Not sure if this request is within your scope of obligation, but do you know what may be causing this? How do I get my data to pipe through instead of this url? My Apex class is returning a list of objects, but the data itself does not come through. Any advice would be appreciated.


    Thanks!
    Eulogio
  • edited March 2, 2018
    Ignore my last message! I figured out what was wrong, I had an incorrect 'Path to Contents'. Thanks anyways :-)
  • Rob HatchRob Hatch 💎💎💎
    edited March 2, 2018
    Glad you got it working! 
  • edited August 16, 2019
    Could you share your solution? I too have the same request, but I need to create records on an object that my users don’t have access to.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!