+ Start a Discussion
vijaymindvijaymind 

Data not showing on VF page

Hi All,

 

I am querying on some standard object like Document contracts etc. I have with sharing controller and Data returning the list but not displaying on VF page. I know why is it happening because user doesnot have Read access to Those standard object.

My question is why query is returinig records to the running user which doent have CRUD permissions ob that object ?

 

 

Thanks

Vijay

Best Answer chosen by Admin (Salesforce Developers) 
Bhawani SharmaBhawani Sharma
Hey Vijay,

Sharing is related to data and CRUD permission is specific to Profile. Sharing keyword take care of what data you can access. Controller does not take care of the Profile setting, but your VF page does. So that's why your are able to query data in controller, but your VF page is not allowing display that data on page as user does not have read permission.

All Answers

kiranmutturukiranmutturu
is your controller is having with sharing keyword or not? have a glance on this

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_keywords_sharing.htm
Bhawani SharmaBhawani Sharma
Probably your object as OWD is public by default. CRUD permission is related to profile not data. So your VF page take care of your profile setting. Even if you make the controller without sharing, that will not make any difference as because of your profile setting you are unable to see data on page.
vijaymindvijaymind

Hi Bhawani ,

Thanks for reply 

But again my question is that user doesnot have even read permission on Document Object and query returning few of the documents records in controller and we have with sharing keyword which enforce the sharing records visibility. 

 

Document object does not have OWD setting as I can see in sharing setting.

 

 

 

Bhawani SharmaBhawani Sharma
Hey Vijay,

Sharing is related to data and CRUD permission is specific to Profile. Sharing keyword take care of what data you can access. Controller does not take care of the Profile setting, but your VF page does. So that's why your are able to query data in controller, but your VF page is not allowing display that data on page as user does not have read permission.
This was selected as the best answer
vijaymindvijaymind

Thanks Bhawani.