refactor platform domain states and permissions

This commit is contained in:
david
2026-07-29 14:25:38 +08:00
parent d4799cd320
commit 35a52c4b06
42 changed files with 507 additions and 364 deletions

View File

@@ -22,8 +22,8 @@ func TestInitPlatformAccessSeedsRootRole(t *testing.T) {
mock.ExpectQuery(regexp.QuoteMeta(`SELECT * FROM "platform_role" WHERE role_code = $1 ORDER BY "platform_role"."id" LIMIT $2`)).
WithArgs("root", 1).
WillReturnRows(sqlmock.NewRows([]string{"id", "identity", "status", "role_code", "name", "data_scope", "is_system"}).
AddRow(uint64(1), "root-role", 1, "root", "Root", "global", true))
WillReturnRows(sqlmock.NewRows([]string{"id", "identity", "status", "role_code", "name", "location_scope", "is_system"}).
AddRow(uint64(1), "root-role", 1, "root", "Root", "precise", true))
if err := InitPlatformAccess(database); err != nil {
t.Fatal(err)