Sub topic 3
List what the integration actually needs
This chapter assumes you know basic Salesforce administration (users, profiles, objects, fields), the REST API and SOQL, and have admin rights in a sandbox or Developer Edition org. Before you create any user or permission set, you write down what the integration does. That list becomes the specification for every later step.
Why start with a list
Least privilege means granting only the access a task requires. You can't apply that rule if you don't know the task. Teams that skip this step usually copy a System Administrator profile "just to make it work." They then keep that access for years.
A requirements list turns "the integration needs access to Salesforce" into specific, checkable statements. Each statement maps to one permission you will grant later.
Questions to answer
Work through the integration's code, its documentation, and the people who own it. Answer these questions for each object it touches.
- Which objects does it read, create, update, or delete?
- Which fields on those objects does it use? Include fields in
SELECTlists, in filters, and in payloads it writes. - Which records must it see? All of them, or a subset such as one region or record type?
- Which API does it call (REST, Bulk, SOAP, Streaming)? Does it call any Apex REST endpoints?
- Does it need any system permission beyond object access, such as
ApiEnabled? - Where does it run from, and how often does it log in?
Question 5 matters because ApiEnabled is not implied by object access. Without it, every API call fails even when the object permissions are correct.
Record the answers in a table
Put the result in a table. A spreadsheet or a wiki page works. The example below describes an integration that syncs accounts into a data warehouse.
| Object | Fields | Read | Create | Edit | Delete | Record scope |
|---|---|---|---|---|---|---|
| Account | Id, Name, Industry | Yes | No | No | No | All accounts |
| Contact | Id, Email, AccountId | Yes | No | No | No | All contacts |
| Opportunity | None | No | No | No | No | Not needed |
Add one line for system permissions: ApiEnabled only. Add one line for the API: REST queries, about 5,000 calls per day.
Listing an object with "No" in every column is useful. It records that you considered the object and decided against access.
Derive permissions from the list
Each row of the table becomes a setting in a permission set. The mapping is direct.
| Requirement | Permission to grant |
|---|---|
| Read Account | `allowRead` on Account |
| Use field Industry | `readable` on `Account.Industry` |
| Never write Account | `allowCreate`, `allowEdit`, `allowDelete` all false |
| All accounts visible | Sharing model access, covered in a later chapter |
| Call the API | `ApiEnabled` user permission |
Common errors at this stage
- Listing objects but not fields. Field-level security is enforced separately. A user with Account read access can still get no value back for a field it can't read.
- Forgetting indirect access. A query on
Contact.Account.Nameneeds read access to Account too. Relationship fields in yourSELECTlists need permissions on the parent object. - Listing what the code could do instead of what it does. If a client library supports deletes but your integration never calls them, leave Delete off.
- Treating the list as permanent. Integrations change. Store the table with the integration's code and update it when the integration changes.
Check the list before you build
Before moving on, confirm three things. Every object has an explicit read, create, edit, and delete decision. Every field in the integration's queries appears in the table. Someone who owns the integration has reviewed the list.
Exercise
A reporting integration runs SELECT Id, Name, Account.Name FROM Contact and never writes data. List the object permissions and field permissions its requirements table should contain.
Show answer
Contact: read only, with create, edit, and delete off. Account: read only, because the query follows the Account.Name relationship. Field read access on Contact.Name and Account.Name. The ApiEnabled system permission is also required. Id fields need no separate field permission.
Exercise
Why is it useful to record objects the integration does not need, with "No" in every column?
Show answer
It shows that you made a decision about each object. A reviewer can later tell an intentional omission from an oversight, and anyone asking for extra access has a record to compare against.