You need to sign in to do that
Don't have an account?
Override Edit button with Visualforce - How to manage record sharing
I've overridden the edit button with a redirect link that directs users to a visualforce edit page. Using this link below:
<apex:page standardController="Guest_Card__c" showheader="false" sidebar="false">
<meta http-equiv="REFRESH" content="0;url=../apex/editguestcard?id={!Guest_Card__c.Id}&mode=edit&returl=%2F{!Guest_Card__c.Id}" />
</apex:page>
The custom edit page has a standard controller with sharing. So, when a user tries to edit a record they do not have access too, it will not let them save. How can I make it so the user doesn't even get redirected to the edit page as it would be confusing for them to allow them to fill the page out, but not let them save.
Is there a way to detect the permissions of the user on the redirect page, and if they have permission to edit the record to direct them to the edit page, but if not, direct them to another page that displays an error?
Thanks for any suggestions!
Try this...
Call the validatePermission() method from the action attribute of the <apex:page /> tag. If the user does not have the permission to update the record, they will be directed to NoAccess page.
Thanks.