Skip to content

Instantly share code, notes, and snippets.

@mtetlow
mtetlow / ApexRESTExample.cls
Created April 10, 2013 14:41
The goal of this gist is to describe how to query an object within a SFDC Managed Package, with a user who is not licensed for access to the managed project. There are two components, an apex class containing a custom REST endpoint, and a VisualForce Page where we hit the SF AJAX Proxy enroute to the SF REST API.
@RestResource(urlMapping='/RestTest/*')
global with sharing class ApexRESTExample {
@HttpGet
global static List<NAMESPACE__ManagedPackageObject__c> getTasks() {
List<NAMESPACE__ManagedPackageObject__c> test = [SELECT Id, Name from NAMESPACE__ManagedPackageObject__c];
return test;
}
}