feat platform dashboard and organization management
This commit is contained in:
@@ -32,6 +32,10 @@ func platformRouteMenuIdentity(resource string) string {
|
||||
switch {
|
||||
case resource == "dashboard":
|
||||
return "dashboard_overview"
|
||||
case resource == "gas_account":
|
||||
return "gas_basic"
|
||||
case resource == "delivery_account":
|
||||
return "delivery_basic"
|
||||
case strings.HasPrefix(resource, "gasorder_contract"):
|
||||
return "gasorder_contract"
|
||||
case resource == "gasorder_track" || resource == "gasorder_track_point":
|
||||
|
||||
@@ -11,8 +11,11 @@ func TestSecondLevelMenuPermissionDoesNotGrantSibling(t *testing.T) {
|
||||
if !platformMenuAllowsPath(menus, "/heqi/platform/v1/delivery_basic") {
|
||||
t.Fatal("selected second-level menu did not grant its resource")
|
||||
}
|
||||
if platformMenuAllowsPath(menus, "/heqi/platform/v1/delivery_account") {
|
||||
t.Fatal("selected second-level menu granted a sibling resource")
|
||||
if !platformMenuAllowsPath(menus, "/heqi/platform/v1/delivery_account") {
|
||||
t.Fatal("delivery management did not grant its embedded account management")
|
||||
}
|
||||
if platformMenuAllowsPath(menus, "/heqi/platform/v1/gas_account") {
|
||||
t.Fatal("delivery management granted gas account management")
|
||||
}
|
||||
if platformMenuAllowsPath(menus, "/heqi/platform/v1/gasorder_basic") {
|
||||
t.Fatal("delivery permission leaked into gasorder")
|
||||
|
||||
Reference in New Issue
Block a user