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