locked
Modeling dynamic role filtered hierarchical menu system RRS feed

  • Question

  • User-217557848 posted

    Hello,

    I'm positive there is nothing new about this question. I am looking into how best to model a hierarchical menu system.

    Goals:

    • Avoid (yet another) pain point. I gather that the point of menus, or any (ultimately) action link, connects with a Controller action. When Controllers change, as they should/do/will, I do not necessarily want to involve another two or three steps in the maintenance of the menus, through things like database, Xml (i.e. "sitemap"), etc.
    • Indicating parent/child should be seamless; Attributes based solutions come to mind, with challenges how to connect parents with children. Presumably, Attributes can decorate Action methods, do so all the time; Menu attributes would decorate key methods, in some way shape or form. Should be possible to Reflect for them and align them in a hierarchical ordering.
    • Should be role filtered; what do I mean by that? If a registered user does not have access to moderator privilege menus, these should be excluded, for example. Conversely, only include those menus for which the user does have privilege. Could be a design time decision, may be more dynamic than that; topic for another discussion; probably.

    This is not an exhaustive set of goals and I'm sure I'm missing some aspects. I am a novice with ASP.NET MVC and not adverse to learning more aspects of architecture along these lines.

    Any tips, tricks, pointers, clues, would be happy to hear them here.

    Thank you...

    Regards,

    Michael Powell

    Thursday, March 3, 2016 8:18 PM

All replies