Package org.pentaho.platform.plugin.services.security.userrole.ldap

Examples of org.pentaho.platform.plugin.services.security.userrole.ldap.DefaultLdapUserRoleListService


    GrantedAuthorityToString transformer2 = new GrantedAuthorityToString();

    LdapSearch usernamesInRoleSearch =
        new GenericLdapSearch( getContextSource(), paramFactory, transformer1, transformer2 );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setUsernamesInRoleSearch( usernamesInRoleSearch );

    List<String> res = userRoleListService.getUsersInRole( defaultTenant, "DEV" ); //$NON-NLS-1$

    assertTrue( res.contains( "pat" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "tiffany" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
      logger.debug( "results of getUsernamesInRole1(): " + res ); //$NON-NLS-1$
    }

    try {
      userRoleListService.getUsersInRole( new Tenant( "/pentaho", true ), "DEV" );
    } catch ( UnsupportedOperationException uoe ) {
      assertNotNull( uoe );
    }
  }
View Full Code Here


    GrantedAuthorityToString transformer2 = new GrantedAuthorityToString();

    LdapSearch usernamesInRoleSearch =
        new GenericLdapSearch( getContextSource(), paramFactory, transformer1, transformer2 );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setUsernamesInRoleSearch( usernamesInRoleSearch );
    userRoleListService.setUsernameComparator( new DefaultUsernameComparator() );

    List<String> res = userRoleListService.getUsersInRole( null, "DEV" ); //$NON-NLS-1$

    assertTrue( res.contains( "pat" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "tiffany" ) ); //$NON-NLS-1$

    assertTrue( res.indexOf( "pat" ) < res.indexOf( "tiffany" ) );
View Full Code Here

    GrantedAuthorityToString transformer2 = new GrantedAuthorityToString();

    LdapSearch usernamesInRoleSearch =
        new GenericLdapSearch( getContextSource(), paramFactory, transformer1, transformer2 );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setUsernamesInRoleSearch( usernamesInRoleSearch );

    List<String> res = userRoleListService.getUsersInRole( null, "DEV" ); //$NON-NLS-1$

    assertTrue( res.contains( "pat" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "tiffany" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
View Full Code Here

    GrantedAuthorityToString transformer2 = new GrantedAuthorityToString();

    LdapSearch usernamesInRoleSearch =
        new GenericLdapSearch( getContextSource(), paramFactory, transformer1, transformer2 );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setUsernamesInRoleSearch( usernamesInRoleSearch );

    List<String> res = userRoleListService.getUsersInRole( null, "DEVELOPMENT" ); //$NON-NLS-1$

    assertTrue( res.contains( "pat" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "tiffany" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
View Full Code Here

    searches.add( usernamesInRoleSearch );
    searches.add( usernamesInRoleSearch2 );
    UnionizingLdapSearch unionSearch = new UnionizingLdapSearch( searches );
    unionSearch.afterPropertiesSet();

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setUsernamesInRoleSearch( unionSearch );

    List<String> res = userRoleListService.getUsersInRole( null, "DEV" ); //$NON-NLS-1$

    assertTrue( res.contains( "pat" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "tiffany" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
      logger.debug( "results of getUsernamesInRole4() with role=ROLE_DEV: " + res ); //$NON-NLS-1$
    }

    res = userRoleListService.getUsersInRole( null, "DEVELOPMENT" ); //$NON-NLS-1$

    assertTrue( res.contains( "pat" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "tiffany" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
View Full Code Here

    Transformer[] transformers = { one, two };
    Transformer transformer = new ChainedTransformer( transformers );

    LdapSearch rolesSearch = new GenericLdapSearch( getContextSource(), paramsFactory, transformer );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setAllAuthoritiesSearch( rolesSearch );

    List res = userRoleListService.getAllRoles();

    assertTrue( res.contains( "ROLE_CTO" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "ROLE_CEO" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
View Full Code Here

    Transformer[] transformers = { one, two };
    Transformer transformer = new ChainedTransformer( transformers );

    LdapSearch rolesSearch = new GenericLdapSearch( getContextSource(), paramsFactory, transformer );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setAllAuthoritiesSearch( rolesSearch );

    List res = userRoleListService.getAllRoles( defaultTenant );

    assertTrue( res.contains( "ROLE_CTO" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "ROLE_CEO" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
      logger.debug( "results of getAllAuthorities1(): " + res ); //$NON-NLS-1$
    }

    try {
      userRoleListService.getAllRoles( new Tenant( "/pentaho", true ) );
    } catch ( UnsupportedOperationException uoe ) {
      assertNotNull( uoe );
    }
  }
View Full Code Here

    Transformer[] transformers = { one, two };
    Transformer transformer = new ChainedTransformer( transformers );

    LdapSearch rolesSearch = new GenericLdapSearch( getContextSource(), paramsFactory, transformer );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setAllAuthoritiesSearch( rolesSearch );
    userRoleListService.setRoleComparator( new DefaultRoleComparator() );

    List res = userRoleListService.getAllRoles();

    assertTrue( res.contains( "ROLE_CTO" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "ROLE_CEO" ) ); //$NON-NLS-1$

    assertTrue( res.indexOf( "ROLE_ADMINISTRATOR" ) < res.indexOf( "ROLE_DEV" ) );
View Full Code Here

    Transformer[] transformers = { one, two };
    Transformer transformer = new ChainedTransformer( transformers );

    LdapSearch rolesSearch = new GenericLdapSearch( getContextSource(), paramsFactory, transformer );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setAllAuthoritiesSearch( rolesSearch );

    List res = userRoleListService.getAllRoles();

    assertTrue( res.contains( "ROLE_SALES" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "ROLE_MARKETING" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
View Full Code Here

    Set searches = new HashSet();
    searches.add( rolesSearch );
    searches.add( rolesSearch2 );
    UnionizingLdapSearch unionSearch = new UnionizingLdapSearch( searches );

    DefaultLdapUserRoleListService userRoleListService = new DefaultLdapUserRoleListService();

    userRoleListService.setAllAuthoritiesSearch( unionSearch );

    List res = userRoleListService.getAllRoles();

    assertTrue( res.contains( "ROLE_DEVMGR" ) ); //$NON-NLS-1$
    assertTrue( res.contains( "ROLE_DEVELOPMENT" ) ); //$NON-NLS-1$

    if ( logger.isDebugEnabled() ) {
View Full Code Here

TOP

Related Classes of org.pentaho.platform.plugin.services.security.userrole.ldap.DefaultLdapUserRoleListService

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.