# springboot-security-demo **Repository Path**: duobab/springboot-security-demo ## Basic Information - **Project Name**: springboot-security-demo - **Description**: spring security使用最简demo - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-03-01 - **Last Updated**: 2024-11-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [![license](https://img.shields.io/github/license/seata/seata.svg)](https://www.apache.org/licenses/LICENSE-2.0.html) [duobab.com](http://www.duobab.com) ## 简介 Spring Security使用最简demo - 拉取代码 - 运行SpringbootSecurityDemoApplication类中的main方法启动 - 程序内置了两个用户+两种角色+三个接口, `/` 所有登录的角色都可以访问 `/grade/all` 角色是老师的可以访问 `/grade` 角色是学生的可以访问 老师默认继承学生的权限,即可以访问学生角色的所有接口 | 用户名 | 密码 | 角色 | | :-----| ----: | :----: | | duobabT | duobabT | teacher | | duobabS | duobabS | student | | 接口 | 请求 | 接口含义 | 哪些角色可以访问 | | :-----| ----: | :----: | :----: | | http://localhost/ | get | 首页 | teacher、student | | http://localhost/grade | get | 查询个人信息 | teacher、student | | http://localhost/grade/all | get | 查询所有人员信息 | teacher | - 本地浏览器访问 http://localhost/ - 本地浏览器访问 http://localhost/grade - 本地浏览器访问 http://localhost/grade/all - 使用不同的角色登录即可看到效果