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

  • 1
  • Question
  • Updated 9 months ago
  • Answered
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?
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
  • unsure

Posted 9 months ago

  • 1
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
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. 
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
Thanks for the recommendation Zach! I'll try your method.
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
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
Photo of Eulogio Gallo

Eulogio Gallo

  • 1,874 Points 1k badge 2x thumb
Ignore my last message! I figured out what was wrong, I had an incorrect 'Path to Contents'. Thanks anyways :-)
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Glad you got it working!