Here are the recommended patterns for handling record access in Experience Cloud sites that pass security review:
1. **Guest User Record Access Settings**: Enable the "Secure Guest User Record Access" setting to ensure guest users have read-only access, preventing unauthorized updates or deletions.
2. **Invocable Apex Methods**: Use invocable Apex methods running in "without sharing" mode for flows requiring guest users to create, query, or update records. This ensures secure DML operations while bypassing sharing rules.
3. **Flow Design**:
- Use Apex Actions for querying and updating records instead of standard flow actions like "Get Records" or "Update Records."
- Run sub-flows in "System Context Without Sharing" to limit elevated access to necessary parts of the flow.
4. **File Uploads**:
- Use custom file upload components or flows that decouple file uploads from record association.
- Ensure sub-flows creating ContentDocumentLink records run in "System Context Without Sharing."
5. **Custom Sharing Rules**: Implement custom sharing rules or logic to manage access to records created or updated by guest users, ensuring compliance with security requirements.
6. **Audit and Validation**: Regularly review and validate sharing settings, permission sets, and Apex classes to ensure alignment with security best practices.
These patterns help maintain a secure and compliant environment for your Experience Cloud sites.