Skip to content

feat(rbac): seed the audit:read permission - #76

Open
Diubii wants to merge 1 commit into
mainfrom
Diubii/audit-read-permission
Open

Diubii wants to merge 1 commit into
mainfrom
Diubii/audit-read-permission

Conversation

@Diubii

@Diubii Diubii commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds migration 0023_audit_read_permission, which seeds audit:read ("Read the audit log") the same way 0016 seeds the rest of the migration catalog: an ordinary permission (managed = false), no role granted, ON CONFLICT (key) DO NOTHING.
  • The snapshot is a copy of 0022's: the schema is unchanged.

Why

The central audit log (PoliNetworkOrg/backend#90) and its dashboard page (PoliNetworkOrg/admin#123) check audit:read, but no environment defines it. Master Admin's wildcard only covers permissions that exist in the catalog (resolveAccess in src/auth/rbac.ts), so today nobody can open the page, not even Master Admin, and it can't be given to any role.

Test plan

  • drizzle-kit migrate on a local DB: the permission is created
  • drizzle-kit check
  • vp check, vp test

🤖 Generated with Claude Code

The backend's central audit log and the admin dashboard page that shows it check
`audit:read`, which no environment defined, so only Master Admin could open it.
Seed it with the rest of the migration catalog so it can be given to a role.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 357abd73-bf34-4295-afa8-ac6ad4ee21b2
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Diubii Diubii self-assigned this Oct 27, 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