Commit graph

806 commits

Author SHA1 Message Date
83812193b6
fix: add actor parameter to Authorization.get_role in Index
Ensure consistent authorization by passing actor parameter to
get_role call, matching the pattern used in Show LiveView.
2026-01-08 16:20:24 +01:00
03c1f747c5
chore: update gettext files and test cleanup
Update translation files after code changes and remove unused
debug logging code from tests.
2026-01-08 16:20:22 +01:00
8d36c0b02c
fix: use reraise instead of raise in rescue blocks
Replace raise with reraise to preserve the original stacktrace when
re-raising exceptions in rescue blocks, improving error debugging.
2026-01-08 16:19:49 +01:00
54c825bac3
refactor: reduce nesting depth in RoleLive handle_event functions 2026-01-08 16:19:49 +01:00
b638a54bd6
feat: prevent deletion of roles with assigned users 2026-01-08 16:19:47 +01:00
954fc4261a
fix: improve contrast for 'No description' text to meet WCAG 2 AA
Change text-base-content/50 to text-base-content/70 for better
accessibility contrast ratio in role index and show pages
2026-01-08 16:19:02 +01:00
a24bbc2188
feat: convert Settings to dropdown menu with sub-items
- Convert Settings menu item to dropdown (similar to Contributions)
- Add Global Settings and Roles as sub-items
- Update German translations: 'Global Settings' and 'Roles'
2026-01-08 16:19:00 +01:00
9c8cdb5e17
feat: add user count display for each role
- Add Users column showing number of users assigned to each role
- Load user counts efficiently in single query to avoid N+1
- Similar implementation to membership fee types member count
2026-01-08 16:18:07 +01:00
36858db97c
feat: add German translations for role management 2026-01-08 16:18:04 +01:00
7d4bc84ce0
refactor: reduce nesting depth in RoleLive.Index.mount
Extract role loading logic into separate private functions to fix Credo warning about nested function body.
2026-01-08 16:16:54 +01:00
2f03f7c00c
feat: assign admin role to admin user in seeds
- Create Admin role if it doesn't exist
- Assign Admin role to admin@mv.local user
- Remove separate create_admin_role script (integrated into seeds)
2026-01-08 16:16:54 +01:00
61c98d1b88
feat: add visible buttons with text for role CRUD operations
- Add text labels to Edit and Delete buttons in index page
- Change button size from btn-xs to btn-sm for better visibility
- Add Delete button to show page for non-system roles
- Implement handle_event for delete in show page
- Add format_error helper to show page
2026-01-08 16:16:54 +01:00
c9b83a501f
fix: prefix unused view variable with underscore
Fix compiler warning for unused variable in role_live_test.exs
2026-01-08 16:16:54 +01:00
9a86e0ec01
feat: implement role management LiveViews
Add complete CRUD interface for role management under /admin/roles.

- Index page with table showing name, description, permission_set_name, is_system_role
- Show page for role details
- Form component for create/edit with permission_set_name dropdown
- System role badge and disabled delete button
- Flash messages for success/error
- Authorization checks using MvWeb.Authorization helpers
- Comprehensive test coverage (22 tests)

Routes added under /admin scope. All LiveViews load user role
for authorization checks. Form uses custom dropdown for permission sets.
2026-01-08 16:16:53 +01:00
ff9c8d2d64
feat: add UI-level authorization helpers
Implement MvWeb.Authorization module with can?/3 and can_access_page?/2
functions for conditional rendering in LiveView templates.

- can?/3 supports both resource atoms and record structs with scope checking
- can_access_page?/2 checks page access permissions
- All functions use PermissionSets module for consistency with backend
- Graceful handling of nil users and invalid permission sets
- Comprehensive test coverage with 17 test cases
2026-01-08 16:16:53 +01:00
6311eebb0c fix linting
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-08 11:41:24 +01:00
b0623b20ed style: remove navbar fixed width 2026-01-08 11:40:22 +01:00
47c46eaebf i18n: update translations 2026-01-08 11:40:04 +01:00
0ccb1c7d79 fix: add label for membership fee type 2026-01-08 11:39:16 +01:00
e565d1748e test: add tests for atomic member field visibility updates 2026-01-08 11:38:41 +01:00
b139d85791 fix: add missing event handler for member field visibility updates 2026-01-08 11:37:39 +01:00
30c43271ea refactor: remove code duplication using helper modules 2026-01-08 11:37:07 +01:00
4a1042ab1a feat: add atomic update for single member field visibility 2026-01-08 11:28:27 +01:00
9af7381843 refactor: extract helper modules to remove code duplication 2026-01-08 11:22:44 +01:00
36776f8e28 fix tests and linting 2026-01-07 18:11:36 +01:00
4a6e7cf51a feat: show only edit or list view in settings 2026-01-07 18:11:07 +01:00
38d106a69e fix: exit date as default hidden column 2026-01-07 12:14:41 +01:00
cbe05c5ca8 fix: cath all rauthy errors 2026-01-07 12:03:58 +01:00
df8c6a1854 Merge branch 'main' into feature/223_memberfields_settings
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 11:42:54 +01:00
ea29fbb58b Merge pull request 'Reduce member fields closes #273' (#319) from feature/273_member_fields into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #319
2026-01-07 11:11:38 +01:00
909d4af2a2 Merge branch 'main' into feature/223_memberfields_settings 2026-01-07 11:11:02 +01:00
d461f75256 Merge branch 'main' into feature/273_member_fields
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-07 11:03:05 +01:00
ee3e1745e0 fix linting errors
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 10:59:20 +01:00
5541cc88d5 Merge pull request 'Adds implementation plan for CSV import closes #287' (#314) from feature/287_plan_csv_import into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #314
Reviewed-by: moritz <moritz@noreply.git.local-it.org>
2026-01-07 10:23:04 +01:00
0c8a255476 Merge branch 'main' into feature/273_member_fields
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 10:22:18 +01:00
f9da798b00 Merge branch 'main' into feature/287_plan_csv_import
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-07 09:58:16 +01:00
a5a1cb7fdd style: remove display name helper in member overview for UX
Some checks failed
continuous-integration/drone/push Build is failing
2026-01-07 09:55:06 +01:00
9f97515d74 chore: movs display name helper to won helper module 2026-01-07 09:54:37 +01:00
29a953c038 fix: prevent migration rollback failure when NULL values exist 2026-01-07 09:52:40 +01:00
e9ee4ce21b docs: adds higher priority to custom field import
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-07 09:35:32 +01:00
e1211fcf0f fix linting
All checks were successful
continuous-integration/drone/push Build is passing
2026-01-07 09:05:51 +01:00
5253286722 Merge pull request 'PermissionSets Elixir Module (Hardcoded Permissions) closes #323' (#324) from feature/323_permissionsets into main
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #324
2026-01-06 22:20:18 +01:00
18ec4bfd16 fix: add missing /custom_field_values/:id page to read_only and normal_user
All checks were successful
continuous-integration/drone/push Build is passing
- Add /custom_field_values/:id to read_only pages (users can view list, should also view details)
- Add /custom_field_values/:id to normal_user pages
- Refactor tests to reduce duplication (use for-comprehension for structure tests)
- Add tests for invalid input types in valid_permission_set?/1
- Update @spec for valid_permission_set?/1 to accept any() type
2026-01-06 22:17:33 +01:00
7845117fad refactor: improve error handling and documentation in PermissionSets
All checks were successful
continuous-integration/drone/push Build is passing
- Add explicit ArgumentError for invalid permission set names with helpful message
- Soften performance claim in documentation (intended to be constant-time)
- Add tests for error handling
- Improve maintainability with guard clause for invalid inputs
2026-01-06 21:55:52 +01:00
9b0d022767 fix: add missing /profile page to read_only and normal_user permission sets
Both permission sets allow User:update :own, so users should be able
to access their profile page. This makes the implementation consistent
with the documentation and the logical permission model.
2026-01-06 21:55:13 +01:00
4bd08e85bb fix: use Enum.empty? instead of != [] to fix type warning
All checks were successful
continuous-integration/drone/push Build is passing
Replace comparison with empty list using Enum.empty?/1 to satisfy
type checker and avoid redundant comparison warning
2026-01-06 21:35:59 +01:00
19a20635a7
docs: update documentation to use CustomFieldValue/CustomField instead of Property/PropertyType 2026-01-06 21:34:07 +01:00
3a0fb4e84f
feat: implement PermissionSets module with all 4 permission sets
- Add types for scope, action, resource_permission, permission_set
- Implement get_permissions/1 for all 4 sets (own_data, read_only, normal_user, admin)
- Implement valid_permission_set?/1 for string and atom validation
- Implement permission_set_name_to_atom/1 with error handling
2026-01-06 21:33:39 +01:00
634d3bd446 Merge pull request 'Authorization Domain and Role Resource closes #321' (#322) from feature/321_authorization_domain into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #322
2026-01-06 19:22:56 +01:00
3265468bd6 test: update role tests for is_system_role API change
All checks were successful
continuous-integration/drone/push Build is passing
Use Ash.Changeset.force_change_attribute to set is_system_role in tests
since it's no longer settable via public API. Remove unused nil clause
from error_message helper.
2026-01-06 19:04:05 +01:00