mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-29 04:27:17 +00:00
A role is granted an API through its menus: saving a role writes a casbin_rule for every API bound to each menu it holds. The seed data bound none to 代码生成 or 代码生成修改, so a role given either menu received no API, which went unnoticed only because every generator route skipped the role check. Migration 1786700011000 binds the nine APIs the generator page calls and the four its edit page calls, creating any that sys_api lacks, and grants them to each role that already holds the menu. Menus are found by component, so renumbered ones are found and deleted ones skipped. Tested on SQLite, MySQL and PostgreSQL, with SQL Server in CI.