Implement inherited sharing in Apex for complex partner portal access
Real World Scenario
Partner users must see Opportunities on shared Accounts but not unrelated Accounts in same partner org. OWD is Private and sharing rules cannot express contract-scoped visibility.
Expected Answer
Follow-Up Questions & Answers
Click to expand — each follow-up includes a direct, interview-ready answer
Main difference: use case and scale. Evaluate inherited sharing keyword for parent-controlled child access. Manual OpportunityShare rows with Apex sharing service in batch recalc. Pick based on your integration pattern and team capability. Partner sharing at scale is batch recalc problem—synchronous trigger share DML fails on bulk contract imports. Optimize for scale and operational observability.
Architect Perspective
Partner sharing at scale is batch recalc problem—synchronous trigger share DML fails on bulk contract imports.