function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JPClark3JPClark3 

Public Access Settings are not allowing access to custom object

I have a page that I've set for the site home page. The controller is querying a custom object (Interest Selections) to display a list of check boxes.

I've set the object access to read-only for the web site user profile (and even tested with full access writes). But the page fails to load when reading from this object.

VF Page:

 

<apex:page Controller="tempELeadImportController" id="ELeadImportPage" showheader="false" sidebar="false" >
 <apex:pageBlock title="Import Detail"  > 
  <apex:OutputText value="{!NewProspectStatus}" /> 
 </apex:pageBlock> 
 <apex:form id="ELeadImportForm" > 
   <!-- other items here that work --> 
   <apex:pageBlockSection showHeader="true" title="I'm interested in" columns="1" collapsible="false">
 
     <apex:selectCheckboxes id="Components" title="Components" value="{!SelectedComponents}" > 
     <apex:selectOptions value="{!ComponentSelections}"/> 
     </apex:selectCheckboxes> 

   </apex:pageBlockSection> 
  </apex:pageBlock> 
 </apex:form> 
</apex:page>

 

 

Apex controller where "ComponentSelections are being created:

global List<SelectOption> ComponentSelections
{
 get
 {
  set<string> componentNames = new set<string>();
    
    // Query the interest selection table to find all the components that are in there. - Note if there are more than 10k records this will break.
    AggregateResult[] validComponents = [SELECT i360__Component__c 
                                        FROM i360__Interest_Selection__c 
                                        WHERE i360__Component__c != null GROUP BY i360__Component__c];
    system.Debug(validComponents);
    for(AggregateResult ar : validComponents)
    {
        string component = (string) ar.get('i360__Component__c');
        componentNames.add(component);
    }
    List<SelectOption> Components = new List<SelectOption>();
    for (string src : componentNames)
    {
        SelectOption option = new SelectOption(src, src);
        Components.Add(option);
    }
    system.Debug(Components);
    return Components;       
  }
}

 

 Even when the web site user profile has FULL access to the "Interest Selections" object, the user cannot read those values. If I change the controller to "without sharing" [WHICH I KNOW IS NOT THE CORRECT FIX] then everything works. Therefore, there is something else stopping the access to these values.

 

 

Best Answer chosen by Admin (Salesforce Developers) 
JPClark3JPClark3

I've been beating my head against the wall on this one.  The package was installed, but not deployed.

 

Found the answer a few posts down.

Found the answer here

All Answers

SkyPlannerSkyPlanner

Hi JPClark3

 

We have a similar problem (see the post: http://boards.developerforce.com/t5/Force-com-Sites/PROBLEM-with-Public-Settings-in-a-SITE-Please-advise/td-p/356263) but so far I haven't found a solution for this. At least you can view your record using "without sharing". Can you please tee us what type of organization are developing in and what licence the guest user of your Site gets assigned? We also created a sharing rule to publish the record to a public gruop we created for the Site user.

 

Thanks in advance.

JPClark3JPClark3

Yes, I saw your post. Maybe there is something worng in the platform causing this issue.

 

I'm in a DE (Developers Edition) ORG. The user gets a "Guest" user license. The Custom Objects we are connecting to are in a managed package that is installed into our ORG.

 

JPClark3JPClark3

I've been beating my head against the wall on this one.  The package was installed, but not deployed.

 

Found the answer a few posts down.

Found the answer here

This was selected as the best answer