feat embed wallets and add withdrawal records
This commit is contained in:
@@ -35,6 +35,12 @@ func platformMenuAllowsRequest(menus []platformbase.Menu, requestPath, method st
|
||||
(menuIdentity == "gasorder_contract" || resource == "user_address") {
|
||||
return true
|
||||
}
|
||||
if method == "GET" && relative == "wallet_basic" &&
|
||||
(menu.Identity == "gas_basic" || menu.Identity == "delivery_basic" ||
|
||||
menu.Identity == "staff" || menu.Identity == "user_account" ||
|
||||
menu.Identity == "wallet_apply_cash") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -46,6 +46,18 @@ func TestCreateOrderPermissionIsSeparateFromOrderManagement(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestOwnerMenusCanReadEmbeddedWallets(t *testing.T) {
|
||||
for _, identity := range []string{"gas_basic", "delivery_basic", "staff", "user_account", "wallet_apply_cash"} {
|
||||
menus := []platformbase.Menu{{Identity: identity}}
|
||||
if !platformMenuAllowsRequest(menus, "/heqi/platform/v1/wallet_basic", "GET") {
|
||||
t.Fatalf("%s could not read its embedded wallet", identity)
|
||||
}
|
||||
if platformMenuAllowsRequest(menus, "/heqi/platform/v1/wallet_basic/owner/user/test", "GET") {
|
||||
t.Fatalf("%s unexpectedly received wallet creation access", identity)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLocationScopeValuesAreExplicit(t *testing.T) {
|
||||
if !validLocationScope("standard") || !validLocationScope("precise") {
|
||||
t.Fatal("supported location scopes were rejected")
|
||||
|
||||
Reference in New Issue
Block a user