Security information is available by obtaining the SecurityContext using @Context, which is essentially the equivalent functionality available on the HttpServletRequest.

SecurityContext can be used in conjunction with sub-resource locators to return different resources if the user principle is included in a certain role. For example, a sub-resource locator could return a different resource if a user is a preferred customer:

@Path("basket")
public ShoppingBasketResource get(@Context SecurityContext sc) {
if (sc.isUserInRole("PreferredCustomer") {
return new PreferredCustomerShoppingBaskestResource();
} else {
return new ShoppingBasketResource();
}
}

最新文章

  1. PHP环境配置
  2. mysql5.7 zip版的配置方法
  3. ADF_Controller系列1_绑定TasksFlow、Region和Routers(Part1)
  4. 关于FlexPaper 2.1.2版本 二次开发 Logo 、打印、搜索、缩略图、添加按钮、js交互、右键菜单、书签等相关问题
  5. IOS 实现自定义的导航栏背景以及自定义颜色的状态栏(支持7.0以及低版本)
  6. 本地wordpress博客系统安装搭建实践
  7. php 设置报错等级
  8. portal---easyui
  9. JavaScript中你所不知道的Object(二)--Function篇
  10. 采用Opserver来监控你的ASP.NET项目系列(三、监控你的服务器状态)
  11. linux ftp及C/S服务架构
  12. mysql 基本sql使用总结-电商项目
  13. c语言构建哈希表
  14. luogu5007 DDOSvoid 的疑惑 (树形dp)
  15. 个人作业-Week1(新增详细说明)
  16. tomcat使用spring-loaded实现应用热部署
  17. java打包jar后,使之一直在linux上运行,不随终端退出而关闭
  18. BZOJ1458:士兵占领(有上下界最小流)
  19. CF494C Helping People 解题报告
  20. Go Session 使用简介

热门文章

  1. 剑指OFFER之链表中倒数第k个节点(九度OJ1517)
  2. mysql CASE WHEN的基础和多种用法
  3. linux 下httpd服务开机启动
  4. Android Study ING
  5. HTTP Post Request using Apache Commons
  6. QM课程03-采购中的质量管理
  7. 创建MySQL从库
  8. Android系统Recovery工作原理之使用update.zip升级过程分析(一)
  9. ConfigurationManager.GetSection()方法的使用
  10. extern的困惑