Package org.pentaho.platform.api.engine.security.userroledao

Examples of org.pentaho.platform.api.engine.security.userroledao.IPentahoUser


      UncategorizedUserRoleDaoException {
      if ( tenant == null ) {
        tenant = getDefaultTenant();
      }

      IPentahoUser targetUser = getUser( tenant, userName );
      if ( targetUser == null ) {
        throw new NotFoundException( "" );
      }

      for ( Set<IPentahoUser> assignedMembers : roleMembersMap.values() ) {
View Full Code Here


      }
    }

    @Override
    public void deleteUser( IPentahoUser user ) throws NotFoundException, UncategorizedUserRoleDaoException {
      IPentahoUser realUser = getUser( user.getTenant(), user.getUsername() );
      if ( realUser != null ) {
        users.remove( realUser );
        userRolesMap.remove( realUser );
        for ( Set<IPentahoUser> assignedUsers : roleMembersMap.values() ) {
          assignedUsers.remove( realUser );
View Full Code Here

        tenantManager.createTenant( systemTenant, TENANT_ID_DUFF, tenantAdminRoleName, tenantAuthenticatedRoleName,
            ANONYMOUS_ROLE_NAME );
    userRoleDao.createUser( tenantDuff, USERNAME_ADMIN, PASSWORD, "", new String[] { tenantAdminRoleName } );

    login( USERNAME_ADMIN, tenantDuff, new String[] { tenantAdminRoleName, tenantAuthenticatedRoleName } );
    IPentahoUser userGeorge = userRoleDao.createUser( tenantDuff, USERNAME_GEORGE, PASSWORD, "", null );
    userRoleDao.createUser( tenantDuff, USERNAME_PAT, PASSWORD, "", null );

    login( USERNAME_GEORGE, tenantDuff, new String[] { tenantAuthenticatedRoleName } );

    RepositoryFile parentFolder =
View Full Code Here

    }
    if ( tenant == null || tenant.getId() == null ) {
      tenant = getCurrentTenant();
    }

    IPentahoUser user = getUser( tenant, userName );
    return Collections.list( Collections.enumeration( userRoles.get( user ) ) );
  }
View Full Code Here

    return Collections.list( Collections.enumeration( tenantUsers.get( tenant ) ) );
  }

  public void setPassword( ITenant tenant, String userName, String password ) throws NotFoundException,
    UncategorizedUserRoleDaoException {
    IPentahoUser user = getUser( tenant, userName );
    if ( user == null ) {
      throw new NotFoundException( userName );
    }
    user.setPassword( password );
  }
View Full Code Here

    IPentahoRole role = getRole( tenant, roleName );
    HashSet<IPentahoUser> users = roleMembers.get( role );
    users.clear();
    if ( userNames != null ) {
      for ( String userName : userNames ) {
        IPentahoUser user = getUser( tenant, userName );
        if ( !userRoles.containsKey( user ) ) {
          userRoles.put( user, new HashSet<IPentahoRole>() );
        }
        userRoles.get( user ).add( role );
        if ( user != null ) {
View Full Code Here

    }
  }

  public void setUserDescription( ITenant tenant, String userName, String description ) throws NotFoundException,
    UncategorizedUserRoleDaoException {
    IPentahoUser user = getUser( tenant, userName );
    if ( user == null ) {
      throw new NotFoundException( userName );
    }
    user.setDescription( description );
  }
View Full Code Here

    }
    roleSet.add( authenticatedRoleName );

    IPentahoRole authRole = getRole( tenant, authenticatedRoleName );

    IPentahoUser user = getUser( tenant, userName );
    roleMembers.get( authRole ).add( user );

    HashSet<IPentahoRole> roles = userRoles.get( user );
    roles.clear();
    for ( String roleName : roleSet ) {
View Full Code Here

    String singleTenantAdminPlainTextPassword = passwordService.decrypt( singleTenantAdminPassword );
    String nonAdminPasswordPlainTextPassword = passwordService.decrypt( nonAdminPassword );

    for ( final String userName : userRoleMappings.keySet() ) {

      final IPentahoUser user = userRoleDao.getUser( DEFAULT_TENANT, userName );

      if ( user == null ) {
        StringBuffer buffer = new StringBuffer();
        if ( logger.isDebugEnabled() ) {
          logger.debug( "Creating user: " + userName );
View Full Code Here

  /**
   * Synchronizes <code>user</code> with fields from <code>proxyUser</code>. The roles set of given
   * <code>user</code> is unmodified.
   */
  public static IPentahoUser syncUsers( IPentahoUser user, ProxyPentahoUser proxyUser ) {
    IPentahoUser syncedUser = user;
    if ( syncedUser == null ) {
      syncedUser = new PentahoUser( proxyUser.getName() );
    }
    syncedUser.setDescription( proxyUser.getDescription() );

    // PPP-1527: Password is never sent back to the UI. It always shows as blank. If the user leaves it blank,
    // password is not changed. If the user enters a value, set the password.
    if ( !StringUtils.isBlank( proxyUser.getPassword() ) ) {
      PasswordEncoder encoder =
          PentahoSystem.get( PasswordEncoder.class, "passwordEncoder", PentahoSessionHolder.getSession() ); //$NON-NLS-1$
      syncedUser.setPassword( encoder.encodePassword( proxyUser.getPassword(), null ) );
    }
    syncedUser.setEnabled( proxyUser.getEnabled() );
    return syncedUser;
  }
View Full Code Here

TOP

Related Classes of org.pentaho.platform.api.engine.security.userroledao.IPentahoUser

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.