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

Bug in Salesforce Site?

Hello All,


I have created one site which is login enabled for customer portal user. This Users are having "High Volume Customer Portal" as profiles assign to it.


I checked which all standard objects can be viewed by this profile and don't have Opportunity in that.


But even though when my class which is without sharing is able to access and perfrom all sorts of DML operation on that object.


This is salesforce bug or I am making some mistake over here. My goal was to access Opportunity Standard Object in Site(Customer Portal Login Enabled) 


Please advise.




Hi Shon,


I think you have brought up great question.


Salesforce documentation states that with/without sharing is about code to make it respect the sharing rules.


But in general sense, people I know believe that with sharing implies profile-based security permissions and has also been my experience. Documentation regarding this very confusing/contradictory to the expereinces I have. 


I have seen people using without sharing just to defy the security (not sharing rules). This is simply not understandable.


I think there are 3 different effects in classes 

1) When we use "With Sharing"

2) When we use "Without Sharing"

3) When we use neither "With Sharing" nor "Without Sharing"


It would be great if some one give some crystal clear facts about the above.




Hi bvramkumar,


Thanks for the reply. Yeah it would be very greatful if any MVP or moderate explain it in more detail.


Please anyone guide me in this more detailed manner.