@Override protected String load() { try { GeoServerRole parentRole = getRoleService(roleServiceName).getParentRole(role); return parentRole != null ? parentRole.getAuthority() : null; } catch (IOException e) { throw new RuntimeException(e); } } }
@Override protected String load() { try { GeoServerRole parentRole = getRoleService(roleServiceName).getParentRole(role); return parentRole != null ? parentRole.getAuthority() : null; } catch (IOException e) { throw new RuntimeException(e); } } }
@Override protected String load() { try { GeoServerRole parentRole = getRoleService(roleServiceName).getParentRole(role); return parentRole != null ? parentRole.getAuthority() : null; } catch (IOException e) { throw new RuntimeException(e); } } }
List<String> computeAllowableParentRoles(GeoServerRole role) throws IOException { Map<String, String> parentMappings = getRoleService(roleServiceName).getParentMappings(); if (role != null && StringUtils.hasLength(role.getAuthority())) { // filter out roles already used as parents RoleHierarchyHelper helper = new RoleHierarchyHelper(parentMappings); Set<String> parents = new HashSet<String>(parentMappings.keySet()); parents.removeAll(helper.getDescendants(role.getAuthority())); parents.remove(role.getAuthority()); return new ArrayList(parents); } else { // no rolename given, we are creating a new one return new ArrayList(parentMappings.keySet()); } }
List<String> computeAllowableParentRoles(GeoServerRole role) throws IOException { Map<String, String> parentMappings = getRoleService(roleServiceName).getParentMappings(); if (role != null && StringUtils.hasLength(role.getAuthority())) { //filter out roles already used as parents RoleHierarchyHelper helper = new RoleHierarchyHelper(parentMappings); Set<String> parents = new HashSet<String>(parentMappings.keySet()); parents.removeAll(helper.getDescendants(role.getAuthority())); parents.remove(role.getAuthority()); return new ArrayList(parents); } else { // no rolename given, we are creating a new one return new ArrayList(parentMappings.keySet()); } }
List<String> computeAllowableParentRoles(GeoServerRole role) throws IOException { Map<String, String> parentMappings = getRoleService(roleServiceName).getParentMappings(); if (!role.getAuthority().equals(GeoServerRole.NULL_ROLE.getAuthority()) ) { //filter out roles already used as parents RoleHierarchyHelper helper = new RoleHierarchyHelper(parentMappings); Set<String> parents = new HashSet<String>(parentMappings.keySet()); parents.removeAll(helper.getDescendants(role.getAuthority())); parents.remove(role.getAuthority()); return new ArrayList(parents); } else { // no rolename given, we are creating a new one return new ArrayList(parentMappings.keySet()); } }