Suppose I have a profile PA_User
and I want to know what kind of permissions(create, edit, view all, modify all etc
) this profile has on Account, opportunity, PAUser
(custom object) objects using APEX. How can I get this information?
Suppose I have a profile PA_User
and I want to know what kind of permissions(create, edit, view all, modify all etc
) this profile has on Account, opportunity, PAUser
(custom object) objects using APEX. How can I get this information?
Best Answer
You can check the
DescribeSObjectResult
for a given object to see if the user can read (queryable
), create (createable
), update (updateable
), or delete (deletable
). You can't ascertain if the user hasView All Data
orModify All Data
, however, as this information isn't available in the normal API. There is an app that can describe a profile's extended permissions and cache them for querying within salesforce.com, but I can't seem to find it right now; you'll need to look around for it. Comments or updates to the answer for the link to that app would be appreciated.