Let the board role decide join requests closes #667 #690

Merged
simon merged 7 commits from issue/mitgliederverwaltung-667 into main 2026-11-16 15:13:07 +01:00
Owner

closes #667

Description of the implemented changes

The changes were:

  • Bugfixing
  • New Feature
  • Breaking Change
  • Refactoring

The board reviews and decides join requests without getting the right to edit members: a new permission set read_and_admit (read like read_only, plus reading and deciding join requests), given to the seeded role "Vorstand" on existing and new installations. Roles on read_only and read_and_admit also change the contact data of their own linked member, like members do.

What has been changed?

  • Take only the missing required values a reviewer fills in when approving
  • Let the board role decide join requests without member write rights
  • Give the seeded board role the right to decide join requests
  • Describe the read_and_admit permission set for the board role
  • Let read-only roles change the contact data of their own member
  • Note the changes in the changelog

Definition of Done

Code Quality

  • No new technical depths
  • Linting passed
  • Documentation is added were needed

Accessibility

  • New elements are properly defined with html-tags
  • Colour contrast follows WCAG criteria
  • Aria labels are added when needed
  • Everything is accessible by keyboard
  • Tab-Order is comprehensible
  • All interactive elements have a visible focus

Testing

  • Tests for new code are written
  • All tests pass
  • axe-core dev tools show no critical or major issues

Additional Notes

  • Who acts on approval: JoinFlow.approve_join_request/2 authorizes the reviewer's :approve by policy, then creates the member as the system actor in the same transaction. Deciding therefore needs no Member create permission. CODE_GUIDELINES §3.5 lists this as a legitimate system-actor use. A test fails if the member is created with the reviewer as actor.
  • Security fix, all reviewer roles: an approval's values are now limited to the required fields the request lacks. Before, a reviewer could set any member field through forged values (e.g. join date, notes, other data fields). Domain test with forged values.
  • Forged-input tests for read_and_admit: direct writes to members, custom field values, fee types and cycles, and groups are refused and change nothing. approve/reject by read_only, own_data or no actor are refused, the request stays undecided and no member is created.
  • Own contact data: read_only and read_and_admit now hold Member :update :linked, which reaches only :update_contact_data. CheckPagePermission opens /members/:id/edit for any member only when the actor has Member update :all (FieldAccess.full_access?/1), otherwise only the own linked member. Before, the check was by the own_data set name. Forged tests cover another member's id, board-only fields and an unlinked user. In the contact-only form, the read-only sections tell board and accounting users "You cannot change this here." instead of "Only the board can change this.". The leave hint stays for members.
  • Migration 20261114120000_board_role_decides_join_requests: the role named "Vorstand" on read_only moves to read_and_admit. The description changes only while it is the seeded text. Other roles are untouched. Rollback restores read_only. Seeds match. The role form lists the new set after read_only.
  • origin/main (#681) is merged in. The branch overlaps it only in router.ex and gettext, with no conflict.

Release: 1.6.0 (wave 1). The CHANGELOG has upgrade notes: the board role now sees and decides join requests including applicant data, and read-only roles may change their own contact data.

Proposed news entry (for the release file once #683 is merged):

  • Title: The board decides join requests
  • Sentence: Board members now see open join requests and approve or reject them themselves, and like every member they can correct their own contact data.
  • Area: Join requests / roles
  • Action needed: no (optional: if the board should stay read-only, set the role "Vorstand" back to read_only)
  • Link: #667
closes #667 ## Description of the implemented changes The changes were: - [x] Bugfixing - [x] New Feature - [ ] Breaking Change - [ ] Refactoring The board reviews and decides join requests without getting the right to edit members: a new permission set `read_and_admit` (read like `read_only`, plus reading and deciding join requests), given to the seeded role "Vorstand" on existing and new installations. Roles on `read_only` and `read_and_admit` also change the contact data of their own linked member, like members do. ## What has been changed? - Take only the missing required values a reviewer fills in when approving - Let the board role decide join requests without member write rights - Give the seeded board role the right to decide join requests - Describe the read_and_admit permission set for the board role - Let read-only roles change the contact data of their own member - Note the changes in the changelog ## Definition of Done ### Code Quality - [x] No new technical depths - [x] Linting passed - [x] Documentation is added were needed ### Accessibility - [x] New elements are properly defined with html-tags - [ ] Colour contrast follows WCAG criteria - [ ] Aria labels are added when needed - [ ] Everything is accessible by keyboard - [ ] Tab-Order is comprehensible - [ ] All interactive elements have a visible focus ### Testing - [x] Tests for new code are written - [x] All tests pass - [ ] axe-core dev tools show no critical or major issues ## Additional Notes - **Who acts on approval:** `JoinFlow.approve_join_request/2` authorizes the reviewer's `:approve` by policy, then creates the member as the system actor in the same transaction. Deciding therefore needs no Member create permission. CODE_GUIDELINES §3.5 lists this as a legitimate system-actor use. A test fails if the member is created with the reviewer as actor. - **Security fix, all reviewer roles:** an approval's `values` are now limited to the required fields the request lacks. Before, a reviewer could set any member field through forged values (e.g. join date, notes, other data fields). Domain test with forged values. - **Forged-input tests for `read_and_admit`:** direct writes to members, custom field values, fee types and cycles, and groups are refused and change nothing. `approve`/`reject` by `read_only`, `own_data` or no actor are refused, the request stays undecided and no member is created. - **Own contact data:** `read_only` and `read_and_admit` now hold `Member :update :linked`, which reaches only `:update_contact_data`. `CheckPagePermission` opens `/members/:id/edit` for any member only when the actor has Member update `:all` (`FieldAccess.full_access?/1`), otherwise only the own linked member. Before, the check was by the `own_data` set name. Forged tests cover another member's id, board-only fields and an unlinked user. In the contact-only form, the read-only sections tell board and accounting users "You cannot change this here." instead of "Only the board can change this.". The leave hint stays for members. - **Migration `20261114120000_board_role_decides_join_requests`:** the role named "Vorstand" on `read_only` moves to `read_and_admit`. The description changes only while it is the seeded text. Other roles are untouched. Rollback restores `read_only`. Seeds match. The role form lists the new set after `read_only`. - `origin/main` (#681) is merged in. The branch overlaps it only in `router.ex` and gettext, with no conflict. Release: 1.6.0 (wave 1). The CHANGELOG has upgrade notes: the board role now sees and decides join requests including applicant data, and read-only roles may change their own contact data. Proposed news entry (for the release file once #683 is merged): - Title: The board decides join requests - Sentence: Board members now see open join requests and approve or reject them themselves, and like every member they can correct their own contact data. - Area: Join requests / roles - Action needed: no (optional: if the board should stay read-only, set the role "Vorstand" back to `read_only`) - Link: #667
simon merged commit f346c4bddf into main 2026-11-16 15:13:07 +01:00
simon deleted branch issue/mitgliederverwaltung-667 2026-11-16 15:13:07 +01:00
Sign in to join this conversation.
No description provided.