@Component public class JwtPermissionEvaluator extends Object implements org.springframework.security.access.PermissionEvaluator
构造器和说明 |
---|
JwtPermissionEvaluator() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
hasPermission(org.springframework.security.core.Authentication authentication,
Object targetUrl,
Object permission)
hasPermission鉴权方法
这里仅仅判断PreAuthorize注解中的权限表达式
实际中可以根据业务需求设计数据库通过targetUrl和permission做更复杂鉴权
|
boolean |
hasPermission(org.springframework.security.core.Authentication authentication,
Serializable targetId,
String targetType,
Object permission) |
public boolean hasPermission(org.springframework.security.core.Authentication authentication, Object targetUrl, Object permission)
hasPermission
在接口中 org.springframework.security.access.PermissionEvaluator
authentication
- 用户身份targetUrl
- 请求路径,比如,对于用户权限认证,其值为:/analysis/salespermission
- 请求路径权限,比如,对于用户权限认证,其值为:admin:analysis:salespublic boolean hasPermission(org.springframework.security.core.Authentication authentication, Serializable targetId, String targetType, Object permission)
hasPermission
在接口中 org.springframework.security.access.PermissionEvaluator