Spring-jsp判断权限-controller中多个权限的要求
1.
<shiro:hasPermission name="purchase:group:view">
<jsp:include page="${path}/WEB-INF/page/common/head.jsp">
<jsp:param name="isGroupView" value="true"/>
</jsp:include>
</shiro:hasPermission>
<shiro:lacksPermission name="purchase:group:view">
<jsp:include page="${path}/WEB-INF/page/common/head.jsp"/>
</shiro:lacksPermission>
----------------------------------------------------------------------------------
2.
<%@taglib prefix="f6" tagdir="/WEB-INF/tags" %>
<f6:hasAnyPermissions name="maintain:newCarCheck:package,maintain:newCarCheck:template">
《something》
</f6:hasAnyPermissions>
Scripting elements ( <%!, <jsp:declaration ) are disallowed here,使用一个标志位处理
<c:set var="hasNewCarCheckPackageOrTemplatePermission" value="false"/>
<f6:hasAnyPermissions name="maintain:newCarCheck:package,maintain:newCarCheck:template">
<c:set var="hasNewCarCheckPackageOrTemplatePermission" value="true"/>
</f6:hasAnyPermissions>
<c:choose>
<c:when test="${hasNewCarCheckPackageOrTemplatePermission =='true'}">
<c:choose>
<c:when test="${fn:contains('/carCheck/smartCheckModuleSetting.do', requestURI)}">
<a href="<%=path%>/carCheck/smartCheckModuleSetting.do" class="active">智能检测模板设置</a>
</c:when>
<c:otherwise>
<a href="<%=path%>/carCheck/smartCheckModuleSetting.do">智能检测模板设置</a>
</c:otherwise>
</c:choose>-
</c:when>
</c:choose>
----------------------------------------------------------------------------------
3.
多个权限
@RequiresPermissions(value = {Permission.MAINTAIN_NEW_CAR_CHECK_ADD, Permission.MAINTAIN_NEW_CAR_CHECK_PACKAGE_EDIT}) //这个其实是字符串的常量 默认是且的关系
@RequiresPermissions(value = {Permission.MAINTAIN_NEW_CAR_CHECK_ADD, Permission.MAINTAIN_NEW_CAR_CHECK_PACKAGE_EDIT}, logical = Logical.OR) 且改成或
单个权限
@RequiresPermissions("xxx:yyy:delete")
正文到此结束