Skip to content

TobiasHungwe - Mailgun_logger Assignment - #48

Open
tobiashungwe wants to merge 12 commits into
jackjoe:masterfrom
tobiashungwe:feature/member-role-access-and-role-assignment
Open

TobiasHungwe - Mailgun_logger Assignment #48
tobiashungwe wants to merge 12 commits into
jackjoe:masterfrom
tobiashungwe:feature/member-role-access-and-role-assignment

Conversation

@tobiashungwe

@tobiashungwe tobiashungwe commented May 10, 2026

Copy link
Copy Markdown

Role-based access control + role assignment UI

Task 1 — Member role

  • Added member role scoped to Events page and its detail pages
  • Stats, Accounts, and Users blocked in both nav and at route level via pipeline guards
  • Members can still edit their own profile via /profile

Task 2 — Role assignment on Create/Edit user

  • Role checkboxes on Create/Edit forms, visible only to admin/superuser (manage_roles permission)
  • Atomic role assignment using put_assoc — no partial state on failure
  • Server-side guard: role_ids from non-admin POSTs are silently ignored
  • Self-downgrade blocked: a user cannot remove their own roles

Tests

  • Roles.can?/2 for manage_roles across all role types
  • create_user_with_roles/2 and update_user_with_roles/3 covering assignment, replacement, empty list, and atomicity on failure

Definition of Done

Task 1 – Member role

  • Seeding data updated with member role
  • Role-based access implemented and working
  • Build compiles without warnings
  • Application runs

Task 2 – Role assignment

  • Admins and superusers can assign roles via Create/Edit user forms
  • Self-downgrade considered and handled
  • Unit tests written and passing

@tobiashungwe tobiashungwe changed the title Feature/member role access and role assignment TobiasHungwe - Mailgun_logger Assignment May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant