Package org.pentaho.platform.security.userroledao.service

Examples of org.pentaho.platform.security.userroledao.service.UserRoleDaoUserDetailsService


    mp.define( IRoleAuthorizationPolicyRoleBindingDao.class, RoleAuthorizationPolicy.class, Scope.GLOBAL );
    mp.define( ITenantManager.class, RepositoryTenantManager.class, Scope.GLOBAL );
    mp.defineInstance( "singleTenantAdminAuthorityName", new String( "Administrator" ) );
    mp.defineInstance( "RepositoryFileProxyFactory", new RepositoryFileProxyFactory( this.testJcrTemplate, this.repositoryFileDao ) );

    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    List<String> systemRoles = new ArrayList<String>();
    systemRoles.add( "Admin" );
    List<String> extraRoles = Arrays.asList( new String[]{"Authenticated", "Anonymous"} );
    String adminRole = "Admin";
View Full Code Here


    mp.defineInstance( "tenantedRoleNameUtils", tenantedRoleNameUtils );
    mp.defineInstance( "repositoryAdminUsername", repositoryAdminUsername );
    mp.define( IConfiguration.class, SystemConfig.class );
    mp.defineInstance( "RepositoryFileProxyFactory", new RepositoryFileProxyFactory( this.jcrTemplate, this.repositoryFileDao ) );
    mp.defineInstance("useMultiByteEncoding", new Boolean( false ) );
    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    List<String> systemRoles = new ArrayList<String>();
    systemRoles.add( "Administrator" );
    List<String> extraRoles = Arrays.asList( new String[]{"Authenticated", "Anonymous"} );
    String adminRole = "Admin";
    userRoleListService =
View Full Code Here

    List<String> systemRoles = Arrays.asList( USERNAME_ADMIN );
    List<String> extraRoles = Arrays.asList( AUTHENTICATED_ROLE_NAME, ANONYMOUS_ROLE_NAME );
    String adminRole = USERNAME_ADMIN;

    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    UserRoleDaoUserRoleListService service =
      new UserRoleDaoUserRoleListService( userRoleDao, userDetailsService, userNameUtils, systemRoles,
        extraRoles, adminRole );
    userDetailsService.setUserRoleDao( userRoleDao );
    logout();
    login( USERNAME_ADMIN, mainTenant_1, new String[]{ tenantAdminRoleName, tenantAuthenticatedRoleName } );

    List<String> allRolesForDefaultTenant = service.getAllRoles();
    List<String> allRolesForTenant = service.getAllRoles( mainTenant_2 );
View Full Code Here

      USER_DESCRIPTION_6, null );
    logout();
    login( USERNAME_ADMIN, mainTenant_2, new String[]{ tenantAdminRoleName, tenantAuthenticatedRoleName } );
    userRoleDao.createUser( mainTenant_2, USER_7, PASSWORD_7, USER_DESCRIPTION_7, null );
    userRoleDao.createUser( null, USER_8, PASSWORD_8, USER_DESCRIPTION_8, null );
    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );

    List<String> systemRoles = Arrays.asList( USERNAME_ADMIN );
    List<String> extraRoles = Arrays.asList( AUTHENTICATED_ROLE_NAME, ANONYMOUS_ROLE_NAME );
    String adminRole = USERNAME_ADMIN;
View Full Code Here

      userRoleDao.setUserRoles( mainTenant_1, USER_4, new String[]{ ROLE_2, ROLE_4 } );
      fail( "Exception should be thrown" );
    } catch ( Throwable th ) {
      assertNotNull( th );
    }
    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    userDetailsService.setDefaultRole( tenantAuthenticatedRoleName );

    List<String> extraRoles = Arrays.asList( AUTHENTICATED_ROLE_NAME, ANONYMOUS_ROLE_NAME );
    String adminRole = USERNAME_ADMIN;

    UserRoleDaoUserRoleListService service =
View Full Code Here

    logout();
    login( USERNAME_ADMIN, mainTenant_2, new String[]{ tenantAdminRoleName, tenantAuthenticatedRoleName } );
    userRoleDao.setRoleMembers( null, ROLE_4, new String[]{ USER_3, USER_5, USER_7 } );
    logout();
    login( USERNAME_ADMIN, mainTenant_1, new String[]{ tenantAdminRoleName, tenantAuthenticatedRoleName } );
    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    userDetailsService.setDefaultRole( tenantAuthenticatedRoleName );
    List<String> systemRoles = new ArrayList<String>();
    systemRoles.add( USERNAME_ADMIN );

    List<String> extraRoles = Arrays.asList( AUTHENTICATED_ROLE_NAME, ANONYMOUS_ROLE_NAME );
    String adminRole = USERNAME_ADMIN;
View Full Code Here

  public static final String ROLE_DESCRIPTION_2 = "Role Description 2"; //$NON-NLS-1$
  public static final String ROLE_DESCRIPTION_3 = "Role Description 3"; //$NON-NLS-1$

  @Test( expected = UsernameNotFoundException.class )
  public void testLoadUserByUsernameUsernameNotFound() {
    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    userDetailsService.loadUserByUsername( USERNAME );
  }
View Full Code Here

    IPentahoRole pentahoRole = userRoleDao.createRole( mainTenant_1, ROLE_1, ROLE_DESCRIPTION_1, null );
    pentahoRole = userRoleDao.createRole( mainTenant_1, ROLE_2, ROLE_DESCRIPTION_2, null );
    pentahoRole = userRoleDao.createRole( mainTenant_1, ROLE_3, ROLE_DESCRIPTION_3, null );
    userRoleDao.setUserRoles( mainTenant_1, USER_2, new String[] { ROLE_1, ROLE_2, ROLE_3 } );

    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    userDetailsService.setDefaultRole( tenantAuthenticatedRoleName );
    UserDetails userFromService = userDetailsService.loadUserByUsername( USER_2 );

    assertTrue( userFromService.getUsername().equals( USER_2 ) );
    assertTrue( userFromService.getPassword() != null );
    assertTrue( userFromService.isEnabled() == true );
    assertTrue( userFromService.getAuthorities().length == 4 );
View Full Code Here

            tenantAuthenticatedRoleName, ANONYMOUS_ROLE_NAME );
    userRoleDao.createUser( mainTenant_1, USERNAME_ADMIN, PASSWORD, "", new String[] { tenantAdminRoleName } );
    login( USERNAME_ADMIN, mainTenant_1, new String[] { tenantAdminRoleName, tenantAuthenticatedRoleName } );
    IPentahoUser pentahoUser = userRoleDao.createUser( mainTenant_1, USER_2, PASSWORD_2, USER_DESCRIPTION_2, null );

    UserRoleDaoUserDetailsService userDetailsService = new UserRoleDaoUserDetailsService();
    userDetailsService.setUserRoleDao( userRoleDao );
    try {
      userDetailsService.loadUserByUsername( USER_2 );
    } catch ( UsernameNotFoundException unnf ) {
      assertNotNull( unnf );
    }

    cleanupUserAndRoles( mainTenant_1 );
View Full Code Here

TOP

Related Classes of org.pentaho.platform.security.userroledao.service.UserRoleDaoUserDetailsService

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.