Extract duplicate access control logic from multiple LiveView files into a reusable AccessControl helper module. **Changes:** - NEW: lib/towerops_web/live/helpers/access_control.ex - NEW: test/towerops_web/live/helpers/access_control_test.exs - Refactor device_live/index.ex to use AccessControl.verify_site_access/2 and verify_device_access/2 - Refactor device_live/form.ex to use AccessControl.verify_device_access/2 - Refactor alert_live/index.ex to use AccessControl.verify_alert_access/2 - Refactor device_live/show.ex to use AccessControl.verify_device_access/2 - Remove unused Repo aliases from refactored files **Benefits:** - Reduces code duplication across 7+ locations - Centralizes security-critical access checks - Improves testability (helper module has >90% coverage) - Consistent error handling across all LiveViews 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| channels | ||
| components | ||
| controllers | ||
| helpers | ||
| live | ||
| plugs | ||
| endpoint.ex | ||
| gettext.ex | ||
| gettext_helpers.ex | ||
| permissions.ex | ||
| plug_exceptions.ex | ||
| router.ex | ||
| telemetry.ex | ||
| user_auth.ex | ||