zoukankan      html  css  js  c++  java
  • shiro权限

    判断条件是当前用户如果拥有sys:user:edit或sys:user:delete其中的一个就可展示th

      先使用的这个方法

    <shiro:hasAnyRoles name="sys:user:delete,sys:user:edit">
        <th>操作</th>
    </shiro:hasAnyRoles>

      导致的结果就是当前用户即使拥有两个权限也不能展示th

      然后使用这种看起来比价烦的方式才出现的结果

    <shiro:hasPermission name="sys:user:edit">
      <shiro:hasPermission name="sys:user:delete">
         <th>操作</th>
      </shiro:hasPermission>
    </shiro:hasPermission>
    <shiro:hasPermission name="sys:user:edit">
      <shiro:lacksPermission name="sys:user:delete">
        <th>操作</th>
      </shiro:lacksPermission>
    </shiro:hasPermission>
    <shiro:hasPermission name="sys:user:delete">
      <shiro:lacksPermission name="sys:user:edit">
        <th>操作</th>
      </shiro:lacksPermission>
    </shiro:hasPermission>
  • 相关阅读:
    词法分析
    关于编译原理
    词法分析
    编译原理
    对编译原理的一些看法
    spring整合struts2
    spring整合javaWeb
    spring整合hibernate
    spring-transaction事务
    spring-jdbc
  • 原文地址:https://www.cnblogs.com/huayuxiaoxiang/p/8252428.html
Copyright © 2011-2022 走看看