0

While sharing opportunity with Read Only access to users using sharing rule, users are getting edit access as well. OWD for Account is public read only and Opportunity OWD is private.

  • Does user has Modify All permission on Profile level ? Please check the setting for Modify All Data on a profile level. – Devendra Aug 5 '16 at 6:45
  • No at profile level only read create and edit permissions are given. – supriya Aug 5 '16 at 6:51
  • As any permission sets assigned ? – Abhijeet Aug 5 '16 at 7:08
  • Users can able to edit their own Opportunity records. Is there any permission set assigned to users ? – Devendra Aug 5 '16 at 7:09
  • No permission set is assigned and this behavior is same for all users that is users to whom read only permission is assigned are able to edit it as well. – supriya Aug 5 '16 at 7:11
1

Based on this comment

If custom vf page for edit is replaced with standard edit functionality it is working as expected.

It sounds like you are having issues where the VF Edit page is not honoring the OWD model defined in the Sharing Settings

A possible/probable cause is the presence of without sharing on the class definition referencing the Opportunity object - most likely the VF Controller. From the Apex doc:

The with sharing keyword allows you to specify that the sharing rules for the current user be taken into account for a class. You have to explicitly set this keyword for the class because Apex code runs in system context. In system context, Apex code has access to all objects and fields— object permissions, field-level security, sharing rules aren’t applied for the current user.

Some worthwhile reading can also be found in Visualforce in Practice page 51 that discusses how you can have selective sharing control within a class wherein some methods enforce sharing and others don't (using inner classes)

  • Thanks...! this helps. Replacing without sharing by 'With sharing' worked. – supriya Dec 13 '16 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.