I think I'm getting close to the solution, but still I'm stocking it on. I change some things in code and this is the actual code:
& Lt; Ul id = "topMenu" & gt; & Lt; Li th: each = "menuIntext: $ {@menmenu.getmenuitem ()}" & gt; & Lt; Div & gt; & Lt; "Th: $ {menuItem.getLabel ()}" th: href = Gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Ul class = "topSubMenu" th: if = "$ {menuItem.getSubItems ()}! = Null" & gt; & Lt; Li: each = "sub menu: $ {menuItem.getSubItems ()}" th: class = "$ {subMenu.getSubItems ()}! = Tap? 'Hpit-topCategory'" gt; & Lt; Div & gt; & Lt; A th: text = "$ {subMenu.getLabel ()}" th: href = "$ {subMenu.getUrl ()}" style = "display: block" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; Ul class = "topSubMenu" th: if = "$ {subMenu.getSubItems ()}! = Null" & gt; & Lt; Li th: each = "sub-category: $ {subMenu.getSubItems ()}" & gt; & Lt; Div & gt; & Lt; A th: text = "$ {subCategory.getLabel ()}" th: href = "$ {subCategory.getUrl ()}" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Neo & gt;
I used a user:
& lt; Username = "David-gh" password = "p" authorization = "ROLE_USER, ROLE_ADMIN, ROLE_BLAH" / & gt;
and other users:
& lt; User Name = "david-gh2" password = "p" Officials = "ROLE_USER, ROLE_ADMIN" />
Loading menu:
bean square = "web.data.MenuItem" & gt; & Lt; Constructor-arg value = "home" /> & Lt; Constructor-arg value = "/" /> & Lt; Constructor-arg value = "ROLE_USER" /> & Lt; / Bean & gt; & Lt; Bean class = "web.data.MenuItem" & gt; & Lt; Constructor-arg value = "evaluation" /> & Lt; Constructor-arg value = "###" /> & Lt; Constructor-arg value = "ROLE_BLAH" /> & Lt; Manufacturer-Arg & gt; & Lt; List & gt; & Lt; Bean class = "web.data.MenuItem" & gt; & Lt; Constructor-arg value = "new evaluation request" /> & Lt; Constructor-arg value = "/ requestClient" /> & Lt; Constructor-arg value = "ROLE_USER" /> & Lt; / Bean & gt; & Lt; / List & gt; & Lt; / Creator-arg & gt; & Lt; / Bean & gt;
So all such behavior should be seen with: David-gh
, but should not see evaluation from david-gh2
. For now I am seeing both things, so I guess the command line:
This is not working as it does not work as th: sec: authorize = "$ {hasAnyRole (menuItem.getRoles ())}"
May be done.
Can someone give me a hand ???
So I fix my own problem and the answer is that there is a bug in thymeleaf which is a class Inside information does not correct. I look at this solution to fix this:
& lt; Div: if = "$ {# authorization.expression ('hasAnyRole (' '__ $ {menuItem.getRoles ()} __' ')')}" & gt;
This is not really a good thing but do work for now :)
No comments:
Post a Comment