+ Start a Discussion

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) 

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


SF DEV wiki article