本文整理了Java中org.hswebframework.web.authorization.Authentication.getRoles()
方法的一些代码示例,展示了Authentication.getRoles()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Authentication.getRoles()
方法的具体详情如下:
包路径:org.hswebframework.web.authorization.Authentication
类名称:Authentication
方法名:getRoles
暂无
代码示例来源:origin: hs-web/hsweb-framework
/**
* 根据id获取角色,角色不存在则返回null
*
* @param id 角色id
* @return 角色信息
*/
default Optional<Role> getRole(String id) {
if (null == id) {
return Optional.empty();
}
return getRoles().stream()
.filter(role -> role.getId().equals(id))
.findAny();
}
代码示例来源:origin: hs-web/hsweb-framework
String[] real = conf.split("[:]", 2);
if (real.length < 2) {
temp = authentication -> !authentication.getRoles().isEmpty();
} else {
temp = AuthenticationPredicate.role(real[1]);
代码示例来源:origin: hs-web/hsweb-framework
.getRoles()
.stream()
.map(role -> allows.getOrDefault("roles", Collections.emptyMap()).get(role.getId()))
代码示例来源:origin: hs-web/hsweb-framework
? authentication.getRoles().stream()::anyMatch
: authentication.getRoles().stream()::allMatch;
access = func.apply(role -> rolesDef.contains(role.getId()));
代码示例来源:origin: org.hswebframework.web/hsweb-authorization-basic
.getRoles()
.stream()
.map(role -> allows.getOrDefault("roles", Collections.emptyMap()).get(role.getId()))
代码示例来源:origin: org.hswebframework.web/hsweb-authorization-basic
? authentication.getRoles().stream()::anyMatch
: authentication.getRoles().stream()::allMatch;
access = func.apply(role -> rolesDef.contains(role.getId()));
内容来源于网络,如有侵权,请联系作者删除!