Spring Security vS AngularJS -> Problems when using sec:authorize tag

[亡魂溺海] 提交于 2020-01-05 09:30:57

问题


I am creating a dynamic menu, all info of the menu I am getting from mysql database.

In my 'menu' database, there's a column called "role_access", where I can manipulate the roles. My intention is to fill this column in the database for each rule I have, then using the code below I could show/hide the menus depending if the client is USER or ADMIN.

                <sec:authorize access="hasRole('{{roleAccess}}')">
                    <li class="menu-dropdown classic-menu-dropdown "><a
                        data-hover="megamenu-dropdown" data-close-others="true"
                        data-toggle="dropdown" href="javascript:;"> <span
                            ng-bind="menu.nome"></span>
                    </a>
                        <ul class="dropdown-menu pull-left">
                            <li ng-repeat="menu in menu.submenus"><a
                                href="{{menu.nomeRecurso}}"><span ng-bind="menu.nome"></span></a>
                            </li>

                        </ul></li>

                </sec:authorize>

But, when loading the page, Spring Life's Cycle (loads everything before) is different from AngularJS (loads everything after page is loaded).

So, when using {{roleAcess}}, AngularJS is not loading my menu. If I force this roleAccess manually without the {{}}, it works.

Thanks in advance.

来源:https://stackoverflow.com/questions/33551694/spring-security-vs-angularjs-problems-when-using-secauthorize-tag

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!