Package org.geoserver.security.impl

Examples of org.geoserver.security.impl.RoleHierarchyHelper


     * @see org.geoserver.security.GeoserverRoleStore#setParentRole(org.geoserver.security.impl.GeoserverRole, org.geoserver.security.impl.GeoserverRole)
     */
    public void setParentRole(GeoServerRole role, GeoServerRole parentRole)
            throws IOException {
       
        RoleHierarchyHelper helper = new RoleHierarchyHelper(getParentMappings());
        if (helper.isValidParent(role.getAuthority(),
                parentRole==null ? null : parentRole.getAuthority())==false)
            throw new IOException(parentRole.getAuthority() +
                    " is not a valid parent for " + role.getAuthority());   

       
View Full Code Here


            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
View Full Code Here

TOP

Related Classes of org.geoserver.security.impl.RoleHierarchyHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.