feat(shop-role): 实现店铺角色继承功能和权限检查优化
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m39s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 6m39s
- 新增店铺角色管理 API 和数据模型 - 实现角色继承和权限检查逻辑 - 添加流程测试框架和集成测试 - 更新权限服务和账号管理逻辑 - 添加数据库迁移脚本 - 归档 OpenSpec 变更文档 Ultraworked with Sisyphus
This commit is contained in:
@@ -27,9 +27,10 @@ func TestRoleAssignmentLimit_PlatformUser(t *testing.T) {
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
@@ -71,10 +72,11 @@ func TestRoleAssignmentLimit_AgentUser(t *testing.T) {
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
@@ -118,11 +120,12 @@ func TestRoleAssignmentLimit_EnterpriseUser(t *testing.T) {
|
||||
accountStore := postgres.NewAccountStore(tx, rdb)
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
@@ -165,12 +168,13 @@ func TestRoleAssignmentLimit_SuperAdmin(t *testing.T) {
|
||||
|
||||
accountStore := postgres.NewAccountStore(tx, rdb)
|
||||
roleStore := postgres.NewRoleStore(tx)
|
||||
shopRoleStore := postgres.NewShopRoleStore(tx, rdb)
|
||||
accountRoleStore := postgres.NewAccountRoleStore(tx, rdb)
|
||||
shopStore := postgres.NewShopStore(tx, rdb)
|
||||
enterpriseStore := postgres.NewEnterpriseStore(tx, rdb)
|
||||
auditLogStore := postgres.NewAccountOperationLogStore(tx)
|
||||
auditService := account_audit.NewService(auditLogStore)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopStore, enterpriseStore, auditService)
|
||||
service := account.New(accountStore, roleStore, accountRoleStore, shopRoleStore, shopStore, enterpriseStore, auditService)
|
||||
|
||||
ctx := context.Background()
|
||||
ctx = middleware.SetUserContext(ctx, middleware.NewSimpleUserContext(1, constants.UserTypeSuperAdmin, 0))
|
||||
|
||||
Reference in New Issue
Block a user