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
Karna_ShivaKarna_Shiva 

My user is able to see all Opportunities data what ever admin is created

My user is able to see all Opportunities data what ever admin is created

how I can restrict user from viewing or editing.

1. User profile - Opportunity object - read, edit, create access
2. Admin role is CEO
3. User role BU 
4. Under CEO, the BU role is setuped
5. OWD Opportunity access is private
5. No sharing rule or permission sets to give extra access.
Role Structire:
  CEO
      BU


 
Best Answer chosen by Karna_Shiva
Karna_ShivaKarna_Shiva
Now, I have shared the data with role based, its worked out well, instead of sharing data with public groups.

some where in Opportunity Apex share, it is granting read/write access on opportunity data even though i have given read only access on sharing rules for public groups, but I have chaged public groups to roles,its worked as expected.

All Answers

PratikPratik (Salesforce Developers) 
Hi Karna,

As per the scenario you mentioned, the user is getting access to records through role hierarchy as i can see user's role just below the CEO, so whtever records are owned & visible to the users below BU role, the user in BU role can see it. Try changing role of the user and verify if he/she can still see the same records.

Also check for View All Data & Modify All Data permission on profile which can give access to all records.

Thanks,
Pratik
Karna_ShivaKarna_Shiva
Role hierarchy: 
 CEO
     BU
        Account Manager

Opportunity Object - 
No View All Data & Modify All Data permissions on profile
If I changed the role from BU to account Manager then he is getting only his data.

OWD: Opportunity access: private
Karna_ShivaKarna_Shiva
Now, I have shared the data with role based, its worked out well, instead of sharing data with public groups.

some where in Opportunity Apex share, it is granting read/write access on opportunity data even though i have given read only access on sharing rules for public groups, but I have chaged public groups to roles,its worked as expected.
This was selected as the best answer