Package org.springframework.security

Examples of org.springframework.security.GrantedAuthorityImpl


  protected Set toGrantedAuthorities( final Set rolesAsStringsSet ) {
    Set grantedAuthorities = new HashSet();
    Iterator iter = rolesAsStringsSet.iterator();
    while ( iter.hasNext() ) {
      String auth = (String) iter.next();
      grantedAuthorities.add( new GrantedAuthorityImpl( auth ) );
    }
    return grantedAuthorities;
  }
View Full Code Here


  protected Object transformItem( final Object obj ) {
    Object transformed = obj;
    if ( obj instanceof String ) {
      String converted = rolePrefix + ( convertToUpperCase ? ( (String) obj ).toUpperCase() : obj.toString() );
      transformed = new GrantedAuthorityImpl( converted );
    }
    return transformed;
  }
View Full Code Here

    if ( roleMapper != null ) {
      List<GrantedAuthority> currentAuthorities = new ArrayList<GrantedAuthority>();
      currentAuthorities.addAll( authorities );

      for ( GrantedAuthority role : currentAuthorities ) {
        GrantedAuthority mappedRole = new GrantedAuthorityImpl( roleMapper.toPentahoRole( role.getAuthority() ) );
        if ( !authorities.contains( mappedRole ) ) {
          authorities.add( mappedRole );
        }
      }
    }
View Full Code Here

   * @param defaultRole
   *          the role name, including any desired prefix.
   */
  public void setDefaultRole( String defaultRole ) {
    Assert.notNull( defaultRole );
    this.defaultRole = new GrantedAuthorityImpl( defaultRole );
  }
View Full Code Here

    this.userDetailsService = userDetailsService;
  }

  public void setDefaultRole( final String defaultRole ) {
    Assert.notNull( defaultRole );
    this.defaultRole = new GrantedAuthorityImpl( defaultRole );
  }
View Full Code Here

      List<GrantedAuthority> newRoles1 = new ArrayList<GrantedAuthority>();
      // Map Non-pentaho roles to pentaho roles. This mapping is defined in the
      // applicationContext-spring-security-ldap.xml
      if ( roleMapper != null ) {
        for ( GrantedAuthority authority : origRoles ) {
          newRoles1.add( new GrantedAuthorityImpl( roleMapper.toPentahoRole( authority.getAuthority() ) ) );
        }
      }

      if ( !origRoles.contains( defaultRole ) ) {
        if ( logger.isDebugEnabled() ) {
View Full Code Here

  protected void loginAsRepositoryAdmin() {
    StandaloneSession pentahoSession = new StandaloneSession( repositoryAdminUsername );
    pentahoSession.setAuthenticated( repositoryAdminUsername );
    final GrantedAuthority[] repositoryAdminAuthorities =
        new GrantedAuthority[]{new GrantedAuthorityImpl( sysAdminRoleName )};
    final String password = "ignored";
    UserDetails repositoryAdminUserDetails =
        new User( repositoryAdminUsername, password, true, true, true, true, repositoryAdminAuthorities );
    Authentication repositoryAdminAuthentication =
        new UsernamePasswordAuthenticationToken( repositoryAdminUserDetails, password, repositoryAdminAuthorities );
View Full Code Here

    final String password = "password";

    List<GrantedAuthority> authList = new ArrayList<GrantedAuthority>();

    for ( String roleName : roles ) {
      authList.add( new GrantedAuthorityImpl( roleName ) );
    }
    GrantedAuthority[] authorities = authList.toArray( new GrantedAuthority[0] );
    UserDetails userDetails = new User( username, password, true, true, true, true, authorities );
    Authentication auth = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
    PentahoSessionHolder.setSession( pentahoSession );
View Full Code Here

    final String password = "password";

    List<GrantedAuthority> authList = new ArrayList<GrantedAuthority>();

    for ( String roleName : roles ) {
      authList.add( new GrantedAuthorityImpl( roleName ) );
    }
    GrantedAuthority[] authorities = authList.toArray( new GrantedAuthority[0] );
    UserDetails userDetails = new User( username, password, true, true, true, true, authorities );
    Authentication auth = new UsernamePasswordAuthenticationToken( userDetails, password, authorities );
    PentahoSessionHolder.setSession( pentahoSession );
View Full Code Here

  protected void loginAsRepositoryAdmin() {
    StandaloneSession pentahoSession = new StandaloneSession( repositoryAdminUsername );
    pentahoSession.setAuthenticated( repositoryAdminUsername );
    final GrantedAuthority[] repositoryAdminAuthorities =
        new GrantedAuthority[] { new GrantedAuthorityImpl( superAdminRoleName ) };
    final String password = "ignored";
    UserDetails repositoryAdminUserDetails =
        new User( repositoryAdminUsername, password, true, true, true, true, repositoryAdminAuthorities );
    Authentication repositoryAdminAuthentication =
        new UsernamePasswordAuthenticationToken( repositoryAdminUserDetails, password, repositoryAdminAuthorities );
View Full Code Here

TOP

Related Classes of org.springframework.security.GrantedAuthorityImpl

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.