I want below rest api in salesforce.

  1. How to check whether the user/organization has access to particular resource ex: Lead is accessible or not?
  2. How to know the limits or access permissions of the user/organization ex: What are the apis the user has the access ex: What are the limits the user has for Lead like CRUD

You can use the sObject Describe method to get all of the information about an sObject, such as if the user has CRUD permissions, which fields the user can access, which of those fields are editable, etc. Note that this call returns information in the current user context, considering their profile and any permission sets they may have assigned. This means that two different users with two different profiles may see different results. If you want to know the access level for an arbitrary user, instead of the current user, you need the Metadata API or Tooling API to learn about the permissions, which will require additional permissions on the profile.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.