0
我想這樣的解決方案:對角色申請認證的配置
- 用戶不同的菜單取決於將被納入模板
- 適當
sec:intercept-url
的只能訪問這些頁面其中專用於角色,因此具有一個角色的用戶將無法訪問其他角色的頁面
您對此解決方案有何看法?
masterLayout
樣子:
<h:body>
<f:subview id="menuUser" rendered="#{sessionBean.user}">
<ui:include src="/WEB-INF/templates/menuBarUser.xhtml" />
</f:subview>
<f:subview id="menuAdmin" rendered="#{sessionBean.admin}">
<ui:include src="/WEB-INF/templates/menuBarAdmin.xhtml" />
</f:subview>
<ui:insert name="content" />
</h:body>
security-context.xml:
...
<sec:intercept-url pattern="/user/**" access="ROLE_USER" />
<sec:intercept-url pattern="/admin/**" access="ROLE_ADMIN" />
...
看起來更容易做,謝謝!將看看它是否會與我的應用程序一起工作 –