Sub topic 2
Record ownership as the starting point
This chapter assumes you know basic Setup navigation, standard and custom objects, and what profiles and permission sets do at a high level. Ownership is the base layer of record access. Every other sharing mechanism in this tutorial adds access on top of it.
What ownership gives a user
Every record has one owner. The owner is a user, or a queue for objects that support queues, such as leads, cases, and custom objects where queues are enabled. A record owned by a queue has no single user as its owner, so access comes from queue membership and the role hierarchy.
The owner of a record gets full access to it: read, edit, transfer, delete, and share. This holds even when the org-wide default for the object is Private. The owner still needs object permissions, though. Ownership works at the record level, so it cannot override a missing Read or Edit permission on the object. Without those permissions, the user cannot work with the record.
Ownership also determines who gets access above the owner. With the role hierarchy enabled, users in roles above the owner's role can usually see the record. That is covered in a later chapter.
Ownership and object permissions
Two checks happen together:
- Object permissions from the profile and permission sets decide whether the user can read, create, edit, or delete records of that object at all.
- Record access decides which individual records the user can reach.
A user needs both to succeed. The owner passes the record check by default, but the object check is still separate.
Changing the owner
Changing the owner changes who has access. Setup and Salesforce handle some of the consequences automatically:
- The previous owner loses the implicit owner access. They keep access only if the org-wide default, the role hierarchy, or another sharing mechanism still grants it.
- Manual shares that gave access to the previous owner are removed when ownership changes. Sharing rules are recalculated for the new owner.
- For accounts, transferring can also move related records, such as opportunities and cases, depending on the options chosen in the transfer.
The owner and the share table
Ownership is not stored as a row in a share object. Salesforce records it on the record's OwnerId field. The owner's access appears in the share table with the row cause Owner, so a query on a share object shows it alongside other grants. This query lists every share row for one custom object record:
SELECT Id, ParentId, UserOrGroupId, AccessLevel, RowCause
FROM Invoice__Share
WHERE ParentId = '<invoice record Id>'For a record with a private default, you would typically see a row with RowCause of Owner and AccessLevel of All. Other rows show access from other sources.
How ownership connects to later chapters
The diagram shows ownership as the starting point and how the other mechanisms build on it.
Each mechanism can only add access. None of them can take away the access that ownership gives.
Common errors
- Assuming ownership overrides object permissions. A user without Read on the object cannot see even their own records.
- Assigning shared work to one person's user. When that person leaves, their records need a new owner. A queue or a team is often a better fit.
- Forgetting that an owner change removes manual shares. Users who had access through a manual share lose it.
Exercise
A user owns an Invoice record, but the profile gives no Read permission on Invoice. Can the user open the record? Why?
Show answer
No. Ownership gives full record-level access, but object permissions are checked separately. Without Read on the Invoice object, the user cannot access any Invoice records, including their own.
Exercise
You transfer an opportunity from Maria to Sam. A colleague had access through a manual share created by Maria. What happens to that access?
Show answer
The manual share is removed when the owner changes, so the colleague loses access unless the org-wide default, the role hierarchy, a sharing rule, or a team still grants it.