本文整理了Java中org.keycloak.models.RealmModel.getTopLevelGroups
方法的一些代码示例,展示了RealmModel.getTopLevelGroups
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RealmModel.getTopLevelGroups
方法的具体详情如下:
包路径:org.keycloak.models.RealmModel
类名称:RealmModel
方法名:getTopLevelGroups
暂无
代码示例来源:origin: org.keycloak/keycloak-model-api
public static List<GroupRepresentation> toGroupHierarchy(RealmModel realm, boolean full) {
List<GroupRepresentation> hierarchy = new LinkedList<>();
List<GroupModel> groups = realm.getTopLevelGroups();
if (groups == null) return hierarchy;
for (GroupModel group : groups) {
GroupRepresentation rep = toGroupHierarchy(group, full);
hierarchy.add(rep);
}
return hierarchy;
}
代码示例来源:origin: org.keycloak/keycloak-model-api
public static GroupModel findGroupByPath(RealmModel realm, String path) {
if (path == null) {
return null;
}
if (path.startsWith("/")) {
path = path.substring(1);
}
if (path.endsWith("/")) {
path = path.substring(0, path.length() - 1);
}
String[] split = path.split("/");
if (split.length == 0) return null;
GroupModel found = null;
for (GroupModel group : realm.getTopLevelGroups()) {
if (group.getName().equals(split[0])) {
if (split.length == 1) {
found = group;
break;
}
else {
if (split.length > 1) {
found = findSubGroup(split, 1, group);
if (found != null) break;
}
}
}
}
return found;
}
代码示例来源:origin: org.keycloak/keycloak-authz-policy-common
List<GroupModel> topLevelGroups = authorization.getRealm().getTopLevelGroups();
内容来源于网络,如有侵权,请联系作者删除!