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
icemft1976icemft1976 

Proper way to test if user has Field Level 'edit' permission

Can someone point me to the documentation of the proper way to query if a user (or the user's profile) has edit permission at an Object's field level?

 

example - "If the user's $Profile has permission to edit a Contact's email field, display this apex:outputText message on the visualforce page"



pseudocode - <apex:outputText render="$Profile.hasPermission(Contact.email, 'Edit')"> Important Message about Emails! </apex:outputText>

 


 I know I could hard code permission checks based on Profile Names/Ids (but I would like to avoid this practice - if I can).

 

I tried using getDescribe to traverse the Profile->Permissions relationships but I couldn't do it.

 

Thanks for any pointers!

Message Edited by icemft1976 on 03-16-2010 10:09 AM
Message Edited by icemft1976 on 03-16-2010 10:55 AM
Best Answer chosen by Admin (Salesforce Developers) 
icemft1976icemft1976

For anyone who didn't take to time to read the docs - ahem - here it is:

 

SF DEV wiki article