Skip to content

fix(doctor): L1: reporting_roles inspects the Tamanu role, not alertd's - #850

Merged
dannash100 merged 1 commit into
mainfrom
fix/reporting-roles-check-user
Aug 27, 2026
Merged

fix(doctor): L1: reporting_roles inspects the Tamanu role, not alertd's#850
dannash100 merged 1 commit into
mainfrom
fix/reporting-roles-check-user

Conversation

@dannash100

Copy link
Copy Markdown
Contributor

reporting_roles resolved its role with WHERE rolname = current_user, so it reported the privileges of the role alertd connects as (alertd), never Tamanu's. That role has no CREATEROLE and ADMIN on nothing, so the check fails on every 2.60+ server: has_createrole: false, roles_administrable: 0.

  • bind the role from config.db.username instead
  • skip when the config carries no db username, Broken when that role has no pg_roles row
  • role added to the details, so the alert says which role it looked at

@passcod

passcod commented Aug 27, 2026

Copy link
Copy Markdown
Member

oh good catch, it used to go via Tamanu's role

@dannash100
dannash100 added this pull request to the merge queue Aug 27, 2026
Merged via the queue into main with commit 6ecefd1 Aug 27, 2026
12 checks passed
@dannash100
dannash100 deleted the fix/reporting-roles-check-user branch August 27, 2026 05:27
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.

2 participants