towerops/test/towerops_web/live
Graham McIntire 6aab59dcf5
refactor: centralize LiveView access control checks
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>
2026-02-04 17:51:05 -06:00
..
account_live fix TOTP enrollment with recovery codes 2026-01-31 14:54:44 -06:00
agent_live test fixes 2026-01-26 15:27:59 -06:00
device_live make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
device_live_nested make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
graph_live make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
helpers refactor: centralize LiveView access control checks 2026-02-04 17:51:05 -06:00
org purge more passkey and gettext updates 2026-02-02 10:20:59 -06:00
org_live Add tests for Monitoring.Ping and OrgLive.New 2026-01-13 08:54:49 -06:00
agent_live_test.exs more tests 2026-02-03 10:43:30 -06:00
alert_live_test.exs make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
dashboard_live_test.exs make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
my_data_live_test.exs make devices site optional and many test fix 2026-02-04 15:05:42 -06:00
org_live_test.exs add device/org limit 2026-01-27 14:14:25 -06:00
user_registration_live_test.exs Use detected timezone from session in user registration 2026-02-01 12:18:33 -06:00
user_reset_password_live_test.exs add HIBP password check 2026-02-01 08:57:01 -06:00
user_settings_live_test.exs feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00