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
Nitin tronixdevNitin tronixdev 

Record Level Security Sharing Rule Issue

Hello, 

 Consider the following situation :
  
     We have a custom object by the name of ABC which contains look up field that associates each record to a particular Contact. Now we want whenever we associate particular record to a Contact then the owner of this contact and its upper level in the Role hierarchy can only view and take action on the record. 

As of now when we are creating a sharing rule then the user with same role can view the record but we want it to be based on the owner of the record. 

Please provide us the sharing rule for the same scenario.



 
SonamSonam (Salesforce Developers) 
As far as I can tell, this is tough to be created using the Out of box sharing rules available, you would have to create a Visualforce page for viewing the custom object and control its access programatically.

https://developer.salesforce.com/forums/ForumsMain?id=906F000000095qJIAQ
https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS
Nitin tronixdevNitin tronixdev
You mean i have to write my own select queries , which checks its owner reocrd and if owner record matches with the current logged in user id , then it should display the records .... ?????
Nitin tronixdevNitin tronixdev
one more doubt I have ...
https://developer.salesforce.com/page/Enforcing_CRUD_and_FLS
in this link you sent to me ,,, every VF page using standard controller as as attribute in apex:page tag
but if i write standard controller then i ll be unable to override tab's standard page with my VF page ...
...................
does this will change the behaviour/permission of the page or not ?
SonamSonam (Salesforce Developers) 
Yes, you will have to write code in order to implement this kind of a sharing rule.

You will be able to override the detail page even with a standard controller, write the sharing functionality in the extension