+ Start a Discussion
Dean Rourk 2Dean Rourk 2 

Account level security in VF pages and controller

We use the account owner and their manager to control who can view accounts.  Owners can only see there accounts.  Works great.

I created a VF page and controller to display a custom object that has a master detail relationship with account.  Everyone can all the accounts.  I don't understand why the the account security is not following through on the VF page.  

Any help would be greatly appreciated.
 
Best Answer chosen by Dean Rourk 2
Ankit Gupta@ DeveloperAnkit Gupta@ Developer
Hi Dean,


Please check your OWD setting for that object for which you are controlling the visibility.
Please use make sure data OWD setting should be private and your controller has with sharing keyword.
 

All Answers

Ankit Gupta@ DeveloperAnkit Gupta@ Developer
Hi Dean,


Please check your OWD setting for that object for which you are controlling the visibility.
Please use make sure data OWD setting should be private and your controller has with sharing keyword.
 
This was selected as the best answer
Dean Rourk 2Dean Rourk 2
I was missing the "with sharing" in the class name.

thanks