You need to sign in to do that
Don't have an account?
Mig
Company Wide Default Setting & Apex = ?
Hi all,
First of all, thanks for your help
The scenario :
- I've got an object with Public Read Only access.
- The Edit button for this object is overriden by a VisualForce Page
Everything works fine but when a user tries to edit someone else record, he can enter into the Edit Record VF page and when he tries to save it works .. but it shouldn't because it's Public Read Only.
Are theApex classes above the company Wide default setting ? How can I solve this problem ?
For info : It's an upsert...
Thanks in advance.
I'd have a try at setting 'with sharing' in the custom controller and seeing if that helps.
You'd need this to override the 'profile settings' of the user and filter the actual records they can read and/or edit due to the sharing rules.
R.
All Answers
Are you using a custom controller or controller extension? If so, the apex will run in System Mode and override the Public Read-Only Access. Link
To enforce the logged in user's access level, I think you want to use a controller extension along with a standard controller and use the standard controller's "save" action.
I'd have a try at setting 'with sharing' in the custom controller and seeing if that helps.
You'd need this to override the 'profile settings' of the user and filter the actual records they can read and/or edit due to the sharing rules.
R.