我想通過用戶登錄顯示菜單。等:如果我用user1登錄,只顯示menu1,menu2,menu3。如果我用user2登錄,只顯示menu2和menu3。JSON結構 - 授權用戶菜單
我已經爲每個模塊創建了JSON結構。
tiles :
{
module1 : [
{
"header":"Data Peserta",
"subheader":"Kepesertaan",
"icon":"sap-icon://log",
"route":"datapeserta"
},
{
"header":"Header1",
"subheader":"Kepesertaan",
"icon":"sap-icon://delete",
"route":"first"
},
{
"header":"Header1",
"subheader":"Kepesertaan",
"icon":"sap-icon://line-charts",
"route":"first"
}
],
module2 : [
{
"header":"Header2",
"subheader":"Layanan dan Manfaat",
"icon":"sap-icon://add-filter",
"route":"first"
},
{
"header":"Header2",
"subheader":"Layanan dan Manfaat",
"icon":"sap-icon://add-filter",
"route":"first"
},
{
"header":"Header2",
"subheader":"Layanan dan Manfaat",
"icon":"sap-icon://action",
"route":"first"
}
],
module3 : [
{
"header":"Header3",
"subheader":"Investasi",
"icon":"sap-icon://activate",
"route":"first"
},
{
"header":"Header3",
"subheader":"Investasi",
"icon":"sap-icon://display-more",
"route":"first"
},
{
"header":"Header3",
"subheader":"Investasi",
"icon":"sap-icon://customize",
"route":"first"
}
]
}
因此,每個模塊都有一個菜單,並且都有3個模塊。如何編輯這個用戶授權的json結構?我在哪裏把用戶的對象放到這個JSON模型中?
謝謝大家。