一、验证当前用户是否为"访客",即未认证(包含未记住)的用户

<shiro:guest>
Hi there! Please <a href="login.jsp">Login</a> or <a href="signup.jsp">Signup</a> today!
</shiro:guest>

二、认证通过或已记住的用户

<shiro:user>
Welcome back John! Not John? Click <a href="login.jsp">here<a> to login.
</shiro:user>

三、已认证通过的用户。不包含已记住的用户,这是与user标签的区别所在。

<shiro:authenticated>
<a href="updateAccount.jsp">Update your contact information</a>.
</shiro:authenticated>

四、未认证通过用户,与authenticated标签相对应。与guest标签的区别是,该标签包含已记住用户。

<shiro:notAuthenticated>
Please <a href="login.jsp">login</a> in order to update your credit card information.
</shiro:notAuthenticated>    

五、输出当前用户信息,通常为登录帐号信息

Hello, <shiro:principal/>, how are you today? 

六、验证当前用户是否属于该角色。

<shiro:hasRole name="administrator">
<a href="admin.jsp">Administer the system</a>
</shiro:hasRole>  

七、与hasRole标签逻辑相反,当用户不属于该角色时验证通过  

<shiro:lacksRole name="administrator">
Sorry, you are not allowed to administer the system.
</shiro:lacksRole>

八、验证当前用户是否属于以下任意一个角色。

<shiro:hasAnyRoles name="developer,manager,administrator">
You are either a developer,manager, or administrator.
</shiro:hasAnyRoles>

九、验证当前用户权限。

<shiro:hasPermission name="create">
<p>当前用户拥有增加的权限!!!!!!!!!!!!!</p>
</shiro:hasPermission> <shiro:hasPermission name="delete">
<p>当前用户拥有删除的权限!!!!!!!!!!!!!</p>
</shiro:hasPermission>

分享知识-快乐自己:Shrio 权限标签的更多相关文章

  1. Shiro 权限标签

    Shiro 权限标签: 导入标签库: <%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" ...

  2. Spring+shiro配置JSP权限标签+角色标签+缓存

    Spring+shiro,让shiro管理所有权限,特别是实现jsp页面中的权限点标签,每次打开页面需要读取数据库看权限,这样的方式对数据库压力太大,使用缓存就能极大减少数据库访问量. 下面记录下sh ...

  3. shrio 权限管理filterChainDefinitions过滤器配置(转)

    shrio 权限管理filterChainDefinitions过滤器配置 /** * Shiro-1.2.2内置的FilterChain * @see ======================= ...

  4. 分享知识-快乐自己:Shrio 案例Demo概述

    Shiro 权限认证核心: POM:文件: <!--shiro-all--> <dependency> <groupId>org.apache.shiro</ ...

  5. 分享知识-快乐自己:Struts2 - result标签的name属性和type属性

    1):result的name属性   例如:<result name="success">/pages/success.jsp</result> Strut ...

  6. 分享知识-快乐自己:论Hibernate中的缓存机制

    Hibernate缓存 缓存: 是计算机领域的概念,它介于应用程序和永久性数据存储源之间. 缓存: 一般人的理解是在内存中的一块空间,可以将二级缓存配置到硬盘.用白话来说,就是一个存储数据的容器.我们 ...

  7. 分享知识-快乐自己:SpringMvc后台Date对象数据 到 前台页面的显示转换

    常常为日期格式的转换而烦恼吗?那么就试试看看楼主的方式吧!让你摆脱烦恼,从而快乐撸码. 如果你只用作于一个日期的显示采用方式如下: 导入:相应的类库 <%@ taglib uri="h ...

  8. 分享知识-快乐自己:mongodb 安装部署(linux)

    1):下载 mongodb 包 [root@admin tools]# wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6. ...

  9. 分享知识-快乐自己:N及分类(双重循环、递归)实现

    实现多级分类: 1.双重 for 循环实现 N 及分类 /*** * 执行遍历 * * @param menus * 所有权限列表集合 * @param list * 指定角色查询到的 权限Id * ...

随机推荐

  1. MongoDB入门学习(1)

    什么是MongoDB ? MongoDB 是由C++语言编写的,是一个基于分布式文件存储的开源数据库系统. 在高负载的情况下,添加更多的节点,可以保证服务器性能. MongoDB 旨在为WEB应用提供 ...

  2. Swing实现系统托盘

    /* 实现系统托盘化 */ protected void setToolSystemTray() { // 系统是否支持系统托盘 if (SystemTray.isSupported()) { // ...

  3. emacs的常用配置备份

    据说有人搞丢了自己的emacs的配置,然后一怒之下抛弃了emacs投身vim,我还是做个emacs配置的备份吧, 虽然我现在也算不上emacs的发烧友. 这里的配置大多是从网上参考的,最多的是下面的链 ...

  4. Google Code Jam 2014 Round 1 A:Problem B. Full Binary Tree

    Problem A tree is a connected graph with no cycles. A rooted tree is a tree in which one special ver ...

  5. Robot Motion - poj 1573

      Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 11269   Accepted: 5486 Description A ...

  6. 嵌入式开发之web服务器---boa移植

    近段时间在做ti8148的编解码器又涉及到boa web服务器的移植.在移植到ARM开发板的过程中,遇到很多的问题.原先的自带thttpd 由于功能没有boa完善,比如在ubuntu下面的utf-8编 ...

  7. saltstack内置执行模块useradd

    useradd模块用于命令行管理用户 salt.modules.useradd.add(name, uid=None, gid=None, groups=None, home=None, shell= ...

  8. 从动态获取div高度的问题展开来看

    ps 可能篇幅比较长,请大家耐心看看 今天有人在群里问我 动态获取高度怎么获取  我就说jq中的outerHeight. height .innerHeight   原生的height clientH ...

  9. POJ 1860

    须要推断是否有正权环存在,Bellman-Ford算法就能够辣~ AC代码: #include <iostream> #include <cstdio> #include &l ...

  10. centos7.0安装redis扩展

    1.下载 下载地址:https://github.com/phpredis/phpredis/ 文件名:phpredis-develop.zip 文件下载成功后,上传至/usr/local 2.安装 ...