database - JSON structure - authorize user menu -


i want showing menu user login. etc: if login user1, show menu1, menu2, menu3. if login user2, show menu2 , menu3.

i create json structure per module.

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"                     }                                        ]         } 

so, each module have menu, , have 3 module. how edit json structure user authorize? put object user json model?

thanks all.

the problem not clear me if want incorporate in same json can put "userlist" array property. thing (i taking example module1):

{ "header":"data peserta", "subheader":"kepesertaan", "icon":"sap-icon://log", "route":"datapeserta", "userlist":["user1","user2","user3"] }, { "header":"header1", "subheader":"kepesertaan", "icon":"sap-icon://delete", "route":"first", "userlist":["user2","user3"] }

this provide controlling access more granularity. in case within module user show header/subheader etc.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -