Salesforce Decode
Salesforcedecode
Security & SharingAdvancedCode Reviewsecuritystandard-objectsapex-sharing

How do you share a record with a user in Apex for standard objects, and what is the caveat?

Scenario

Code inserts AccountShare rows to give partners access, but shares disappear after ownership changes.

Answer it out loud first

Serious prep means attempting before reading. Take two minutes to structure your answer, then compare.