Ensure that the user is able to see the photo they are setting as highlighted#4449
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthrough
ChangesHighlight visibility permission fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
This pull request updates the logic for determining if a photo can be highlighted, ensuring that only users who have permission to view a photo can highlight it. Additionally, it improves the loading of related data for photos by eager-loading access permissions for albums.
Authorization logic improvements:
canHighlightmethod inPhotoPolicyso that only users who can actually see a photo are allowed to highlight it, even for anonymous and authenticated users. This adds an extra layer of security by tying highlight permissions to view permissions.Data loading enhancements:
SetPhotosHighlightedRequest.phpto also eager-loadalbums.access_permissions, ensuring that access permissions are available when processing highlighted photos.Summary by CodeRabbit