Package org.geoserver.security.impl

Examples of org.geoserver.security.impl.RoleCalculator


     
        GeoServerRoleService service = useActiveService ?
              getSecurityManager().getActiveRoleService() :
              getSecurityManager().loadRoleService(getRoleServiceName());
             
        RoleCalculator calc = new RoleCalculator(service);
        return calc.calculateRoles(principal);
    }
View Full Code Here


        UsernamePasswordAuthenticationToken result = null;
        Set<GrantedAuthority> roles = new HashSet<GrantedAuthority>();
        if (details!=null) {           
            roles.addAll(details.getAuthorities());                       
        } else {       
            RoleCalculator calc = new RoleCalculator(getSecurityManager().getActiveRoleService());
            try {
                roles.addAll(calc.calculateRoles(new GeoServerUser(user)));
            } catch (IOException e) {
                throw new AuthenticationServiceException(e.getLocalizedMessage(),e);
            }                       
        }  
        roles.add(GeoServerRole.AUTHENTICATED_ROLE);
View Full Code Here

        GeoServerUser user=null;
        try {
            user = getUserByUsername(username);           
            if (user==null)
                throw new UsernameNotFoundException(userNotFoundMessage(username));
            RoleCalculator calculator = new RoleCalculator(this,
                    getSecurityManager().getActiveRoleService());
            user.setAuthorities(calculator.calculateRoles(user));
        } catch (IOException e) {
            throw new UsernameNotFoundException(userNotFoundMessage(username),e);
        }       
        return user;
    }
View Full Code Here

                               
        for (GeoServerRole role: service.getRoles())
          if (request.isUserInRole(role.getAuthority()))
              roles.add(role);
     
        RoleCalculator calc = new RoleCalculator(service);
        calc.addInheritedRoles(roles);
        calc.addMappedSystemRoles(roles);
        return roles;
    }
View Full Code Here

                GeoServerUserGroupService ugService = getSecurityManager()
                        .loadUserGroupService(ugServiceName);
                GeoServerRoleService gaService = getSecurityManager()
                        .getActiveRoleService();

                RoleCalculator calc = new RoleCalculator(ugService, gaService);
                tmp.addAll(rolePalette.getSelectedRoles());
                calc.addInheritedRoles(tmp);

                for (GeoServerUserGroup group : userGroupPalette.getSelectedGroups()) {
                    if (group.isEnabled()) {
                        tmp.addAll(calc.calculateRoles(group));
                    }
                }
                result.addAll(calc.personalizeRoles(user, tmp));
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
       
            Collections.sort(result);
View Full Code Here

TOP

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

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.