Skip to content

[P1] [bug] FR-7.1.6 Role management — no CREATE ROLE, no role parsing, no UI #435

Closed

Description

@EVWorth

[P1] [bug] Role management (FR-7.1.6) is completely missing — no CREATE ROLE, no GRANT role, no role list

Context

DESIGN_REQUIREMENTS FR-7.1.6: "Create, assign, and manage MySQL roles (MySQL 8.0+)".

Problem

Per docs/audits/admin.md F7.

MySQL 8.0 added roles (CREATE ROLE 'app_read', GRANT 'app_read' TO 'alice', SET DEFAULT ROLE 'app_read' TO 'alice'). Current implementation: no Roles tab, no information_schema.applicable_roles query, no CREATE ROLE / DROP ROLE buttons, no SET DEFAULT ROLE UI. Privileges editor only deals with *.* and db.* grants. parseGrantStatements regex requires ON clause, which role grants don't have — parser silently skips them.

Files

  • src/components/admin/UserManagement.tsx (no roles view)
  • src/components/admin/userPrivileges.ts (no role parsing)
  • src-tauri/crates/mas-admin/src/lib.rs (no role methods)

Repro (if applicable)

Static analysis only.

Expected

CREATE ROLE 'app_read', list roles in UI, assign to user via checkbox, SET DEFAULT ROLE toggle persists.

Proposed fix

Scope M. Add Roles tab in UserManagement; extend parseGrantStatements regex to /^GRANT\s+(.+?)\s+(?:ON\s+(.+?)\s+)?TO\s+/i; emit kind: 'role' | 'privilege' discriminator.

Acceptance

User with GRANT 'app_read'@'%' TO 'alice'@'localhost' shows the role in the Grants view; round-trip preserves the role grant.

Needs human verify

Yes

Labels: audit, area/admin, severity/p1, kind/bug

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/admin
    on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/adminauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions