ef4df57a6f
Restrict Actor.ensure_loaded to Mv.Accounts.User only
...
Pattern match on %Mv.Accounts.User{} instead of generic actor.
Clearer intention, prevents accidental authorization bypasses.
Non-User actors are returned as-is (no-op).
2026-01-27 10:23:13 +01:00
3d753c5460
Add authorize?: false to Actor.ensure_loaded
...
SECURITY: Skip authorization for role loading to avoid circular dependency.
Actor loads their OWN role, needed for authorization itself.
Documented why this is safe.
2026-01-27 10:23:11 +01:00
69836978be
Remove unused PolicyHelpers macro and PolicyConsistency test
...
Dead code - macro was never used in codebase.
PolicyConsistency test will be replaced with better implementation.
2026-01-27 10:23:10 +01:00
213521ecf6
Add centralized Actor.ensure_loaded helper
...
Consolidate role loading logic from HasPermission and LiveHelpers.
Use Ash.Resource.Info.resource? for reliable Ash detection.
2026-01-27 10:23:10 +01:00
ab0407abb1
Replace NoActor runtime Mix.env with compile-time config
...
Use Application.compile_env for release-safety.
Config only set in test.exs (defaults to false).
2026-01-27 10:23:09 +01:00
0d2c8e0905
Add PolicyHelpers macro for standard user policies
...
Encapsulate two-tier policy pattern (bypass + HasPermission).
Promote consistency across resource policy definitions.
2026-01-27 10:23:08 +01:00
3852c93ac9
Centralize role preloading in global LiveView on_mount
...
Add ensure_user_role_loaded to global live_view quote block.
Remove redundant on_mount calls from individual LiveViews.
2026-01-27 10:23:08 +01:00
fb5f4990b8
Shorten User policy comments to state what only
...
Move why explanations to documentation files.
Keep policy comments concise and focused.
2026-01-27 10:23:07 +01:00
87e7310cea
Clarify User.update :own in permission sets
...
Add explicit comments explaining why all permission sets
grant User.update with scope :own for password changes.
2026-01-27 10:23:07 +01:00
7eb7149e18
Add role loading fallback to HasPermission check
...
Extract ash_resource? helper to reduce nesting depth.
Add ensure_role_loaded fallback for unloaded actor roles.
2026-01-27 10:23:07 +01:00
298a13c2e4
Harden NoActor check with runtime environment guard
...
Add Mix.env() check to match?/3 for defense in depth.
Document NoActor pattern in CODE_GUIDELINES.md.
2026-01-27 10:23:06 +01:00
de187190e4
feat(auth): add User resource authorization policies
...
Implement bypass for READ + HasPermission for UPDATE pattern
Extend HasPermission check to support User resource scope :own
2026-01-27 10:23:05 +01:00
d9f5579350
Move require Logger to module level
...
Move require Logger statements from function/case level to module level
for better code organization and consistency with Elixir best practices
2026-01-27 10:23:05 +01:00
214b84b9b3
Add admin authorization check for regenerate cycles button
...
Restrict UI access to cycle regeneration to administrators only
to prevent policy bypass via user interface
2026-01-27 10:14:06 +01:00
ce292b431c
Add logging for fail-open email uniqueness validations
...
Log warnings when query errors occur in email uniqueness checks
to improve visibility of data integrity issues
2026-01-27 10:14:05 +01:00
fa3c34450d
Use SystemActor opts for cycle deletion operations
...
Pass actor_opts to delete_cycles/1 to ensure proper authorization
when MembershipFeeCycle policies are enforced
2026-01-27 10:14:05 +01:00
4537b86a09
Replace Mix.env() with Config.sql_sandbox?() in SystemActor
...
Use Application config instead of Mix.env() to prevent
runtime crashes in production releases where Mix is not available
2026-01-27 10:14:05 +01:00
c86aa4ea9c
Add @spec type annotations to SystemActor functions
...
Add type specifications for all private functions to improve
static analysis with Dialyzer and documentation quality.
2026-01-27 10:14:04 +01:00
8eb05c8a6a
Document System Actor pattern in code guidelines
...
Add section explaining when and how to use system actor for systemic operations.
Include examples and distinction between user mode and system mode.
2026-01-27 10:14:04 +01:00
cf9e6e91fd
Use system actor for cycle generation
...
Update cycle generator, member hooks, and job to use system actor.
Remove actor parameters as cycle generation is a mandatory side effect.
2026-01-27 10:14:03 +01:00
564e35f65e
Use system actor for email uniqueness validation
...
Update email validation modules to use system actor for queries.
This ensures data integrity checks always run regardless of user permissions.
2026-01-27 10:14:03 +01:00
8f06442de9
Use system actor for email synchronization
...
Update email sync loader and changes to use system actor instead of user actor.
This ensures email sync always works regardless of user permissions.
2026-01-27 10:14:03 +01:00
52a482c0e2
Add System Actor helper for systemic operations
...
Introduce Mv.Helpers.SystemActor module with lazy loading
for operations that must always run regardless of user permissions.
System actor has admin role and auto-creates in test environment.
2026-01-27 10:14:02 +01:00
41d680f994
fix: failing test
2026-01-27 10:14:02 +01:00
0016c43c34
feat: improve filter performance by reducing Ash.read! calls
2026-01-27 10:14:01 +01:00
0d244a4860
fix: resolve pr remarks
2026-01-27 10:14:01 +01:00
ca1300f46a
feat: add new filter component to members view
2026-01-27 10:13:59 +01:00
7171e21a10
feat: load boolean custom fields
2026-01-27 10:13:59 +01:00
7f4c22d072
refactor: fix credo issues
2026-01-27 10:13:58 +01:00
4e48ace2d4
refactor: Reduce function complexity and nesting depth
...
- Extract helper functions from process_chunk to reduce nesting
- Extract format_error_message from extract_changeset_error
- Split extract_error_message into smaller functions to reduce complexity
- Fixes Credo refactoring opportunities
2026-01-27 10:13:56 +01:00
c137ee6221
refactor: Replace length/1 with empty list comparison
...
Replace expensive length/1 calls with direct list comparison
to fix Credo warnings about performance
2026-01-27 10:13:56 +01:00
4154296b54
refactor: Remove deprecated LiveViews
...
- Remove CustomFieldValueLive (Index, Form, Show)
- Remove ContributionTypeLive.Index
- Remove ContributionPeriodLive.Show
- Remove corresponding routes from router
- Remove references in CustomFieldValueLive.Index
2026-01-27 10:13:55 +01:00
d72bb8869f
docs: Update domain Public API documentation
2026-01-27 10:13:55 +01:00
926974e2da
chore: update docs
2026-01-27 10:13:54 +01:00
da9ec06e8e
feat: implement filter logic for boolean ustom fields
2026-01-27 10:13:53 +01:00
0519433644
feat: add custom boolean field state & URL-Parameter
2026-01-27 10:13:53 +01:00
d8ab9a1015
fix: linting + tests
2026-01-27 10:13:52 +01:00
3aa1aee11e
fix: add error message to form
2026-01-27 10:13:51 +01:00
22593af621
refactor: change length for performance
2026-01-27 10:13:51 +01:00
6c840e73d1
formatting
2026-01-27 10:13:51 +01:00
257739d273
feat: adds error capping
2026-01-27 10:13:50 +01:00
24426c7786
Merge branch 'main' into feature/333_validation
2026-01-19 11:46:14 +01:00
7da037d81d
refactor: adds schemales changeset and validation constant
2026-01-19 11:43:51 +01:00
8b3cc6a6b2
feat: adds row validation
2026-01-19 11:22:11 +01:00
54d96136b7
fix: link/button semantics
2026-01-16 17:16:06 +01:00
c86ae6aa9d
fix: sidebar accessibility
2026-01-16 14:17:15 +01:00
c3515b4105
feat: adjust display of submenu
2026-01-16 13:53:31 +01:00
74af41c8ab
feat: reorder sidebar
2026-01-16 12:46:45 +01:00
6dc398fa5a
refactor: reduce complexity
2026-01-15 17:00:17 +01:00
67072f0c52
feat: adds header header normalization
2026-01-15 16:11:09 +01:00